I am using Log4j as my logger with Spring. I did everything as per the basic tutorial and tried to write log messages in a log file. But every attempt to this is failed
my web.xml file is
The log4j.properties file is
Then in my controller i wrote a code to add message to text file
No matter what, it's not working. but when i try to print it in console, its printing. Please help me where i went wrong?
Never try to be a hard-worker. Be a smart-worker.
My Blog
Christophe Verré wrote:Where did you put log4j.properties ? Under WEB-INF ?
Yes it is under WEB-INF folder. As i said earlier there is no problem in detecting the prop file. Because the log messages got printed in console but when i try to write them to a file, it isn't writing. The log.txt file is also under WEB-INF.
Never try to be a hard-worker. Be a smart-worker.
My Blog