Step 1 - i import external jar slf4j.api-1.7.5.jar. (That is not mentioned in your document) And Do like in your Document.
Step 2 - I don't want to create log for Each java class, so create a one static class and wrote like this
Code: Select all
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Globe
{
public static Logger log = LoggerFactory.getLogger(Globe.class);
}
I have lots class so i decide to import the globe class, where i want to put logger like below
Code: Select all
Globe.log.info("Hello World");
I don't know lapo. this is best practice or not. I need your suggestion. I want to create the log variable only once it can work to all class. Anyone can also help with us.