Hi, I have a strange problem.If the level="debug",everything is fine(xml configuration file). If level is changed to WARN,logging is stopped.It just logs one message and then just stops logging any further messages.
Can any body suggest me ways for troubleshooting the problem.What are the things i can check in this case?
Thats what the WARN level is supposed to do. It will suppress all logs which are lesser than the WARN level. Since your debug and info level messages are lesser than the WARN level, they will not show up in the logs.
Hi Jaikiran, Thanks for your time.But my problem is that after one WARN level log message ,no further WARN level logs are being logged into the log file. I mean to say that logging is stopped after one WARN level message. I dont know where to look for the solution. But everything is working fine for DEBUG level.
I forgot to mention that if the LEVEL is WARN then the catalina.out also contains these one or two WARN messages before the logging is completely stopped.If the level is DEBUG then there is no log messages in catalina.out and only my log file contains these log messages. Is there any chance that tomcat logging is somehow colliding with application logging? thanks, ajse
I have only one application in my webapps folder and only one log4j.xml. The root logger has level WARN and one package logger has level WARN.There are no other levels specified in the log4j. regards, ajse
Hi jaikiran, After two WARN messages,there are no further WARN messages.I am taking about the log file in production. Let me make it clear....previously there were many WARN level messages in a fixed interval of time but now because of the issue the log file just shows two WARN messages and then no further messages in the same interval of time. i.e logger.warn() is not working after putting two messages. regards, ajse
Ok, i now get what you are saying We would need some more information to figure out what's causing this. Could you post the log4j.xml file that you are using. Also some part of the code where you are instantiating the logger and then logging these logger.warn messages.
Hi , i forgot to mention.If the level is WARN then DailyRollingFileAppender is not creating new files i.e for three days same log file is there and if the level is DEBUG then everything is fine. regards, ajse
Try adding the BufferSize to your appender configuration as follows:
I am just taking a guess here. You are using the AsyncAppender which appends (sends log events) asynchronously. By default the BufferSize is 128, which means the log messages will be written after 128 log events. The reason why its working for DEBUG might have to do with the fact there the frequency of debug logs might be higher compared to the warn messages. Again, i havent used AsyncAppender and this is just a guess that i am taking based on its javadoc. If this works, you will then have to decide whats a good value for the BufferSize.