I am trying to learn about log4j so I just tried to do something which is very simple;
Logger logger = Logger.getLogger("ClientApplicationLog");
logger.info("Logger Test");
But after making this I got;
log4j:WARN No appenders could be found for logger (ClientApplicationLog).
log4j:WARN Please initialize the log4j system properly.
Do you know where I am wrong ?
Thank you all
You’re missing the
log4j.propertiesorlog4j.xmlin your classpath.You can bypass this by using
But beware this will ONLY log to System.out and is not recommended. You should really use one of the files above and write to a log file.
A very simple example of
log4j.propertieswould be