We will be moving our Application in production .
For this , We have added log4j support to the Application .
I have got this log4j.properties file from internet , and i put this file inside the classes folder of my Web Application .
log4j.rootCategory=DEBUG, A1
# A1 is a DailyRollingFileAppender
log4j.appender.A1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A1.file=/MyWebApplication.log
log4j.appender.A1.datePattern='.'yyyy-MM-dd
log4j.appender.A1.append=true
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-5p %d{ISO8601} [%t] %l %C{5}:%M - %m%n
Is the above properties file suitable for a high-volume website?
No, not really. You’ll set all logging to
DEBUGlevel, which is likely to generate vast amounts of logging (especially if you use 3rd-party libraries such as Spring or Hibernate). Not only will this make your logs difficult to read, it may also serious impact performance (log4j doesn’t actually perform well under high load and concurrency, it’s full ofsynchronizedblocks).I suggest you turn your logging down to
INFO, and perhaps evenWARN.