Tuesday 19 June 2012

Logging messages in Struts 2.0

Enable Detailed Log:

first we set the constant struts.devMode to true, because we are working in development environment and we need to see some useful log messages.

You can enabled complete logging functionality while working with Struts 2 by creating logging.properties file under WEB-INF/classes folder. Keep the following two lines in your property file:
 
org.apache.catalina.core.ContainerBase.[Catalina].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].handlers = \
                              java.util.logging.ConsoleHandler
The default logging.properties specifies a ConsoleHandler for routing logging to stdout and also a FileHandler. A handler's log level threshold can be set using SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST or ALL.

No comments:

Post a Comment