I would like to configure my log4j file for a production environment with struts2. I have the below configuration…
log4j.logger.com.opensymphony.xwork2=ERROR
log4j.logger.ognl=ERROR
log4j.logger.org.apache=WARN
log4j.logger.org.apache.struts2=ERROR
log4j.logger.org.apache.struts2.util.StrutsTypeConverter=ERROR
log4j.logger.freemarker=ERROR
#apache torque which is my ORM needs to be add debug.. so I can see SQLs being
#printed
log4j.logger.org.apache.torque=DEBUG
#this is my source package base which need be at debug
log4j.logger.com.aesthete=DEBUG
The above configuration is fine, except that any errors in struts2 is not being printed out to the log at all. Would be grateful for some help in the correct configuration that most users in a production environment running struts2.
ERRORis really restrictive; I couldn’t recommend that for production.WARNis the absolute least I’d have in production–you could miss a lot of very important information, particularly at startup.IMO,
INFOis more-typical, and most useful.DEBUGshould rarely be used in a production environment; if you’re relying on it I’d suggest that your logging was put in the code at the wrong level.DEBUGis for just that–debugging.I’ve never restricted S2 to anything greater than
WARN, but I tend to leave things atINFOlevel unless specifically trying to debug an issue. On production I also use a fast layout, again unless there’s a particularly component that’s being worked on.