How can I set the log level in my application?
From WebRatio WebML Wiki
|
WebRatio offers the chance to configure the application log in order to see debug information about the WebRatio runtime.
There are four log files placed in the Web application directory under the folder WEB-INF\log
- RTX.log
- RTXError.log
- WRStruts.log
- WRStrutsError.log
The first two files log information about the WebRatio Runtime framework and Hibernate framework. The second two files log information about the WebRatio action classes developed within the Struts framework. With the default settings the Web application logs only the errors in the RTXError.log and WRStrutsError.log files. You can change this behaviour and tune the level of logging by editing two configuration files placed in the directory WEB-INF\conf.
RTXLogConfig.properties
In this file you can assign different log level to different information types. You can choose to see all the query performed by Hibernate setting the log level of Hibernate to DEBUG
log4j.logger.org.hibernate.SQL=DEBUG, RTXLogFile
You can choose to see all the information about the WebRatio Runtime framework setting the log level of the rtx to DEBUG
log4j.logger.com.webratio.rtx=DEBUG, RTXLogFile, RTXErrorLogFile
You can choose to see the all the information about the WebRatio units setting the log level of the units to DEBUG
log4j.logger.com.webratio.units=DEBUG, RTXLogFile, RTXErrorLogFile
Note that in this way are logged only the units having the Java Service class located in a package starting with com.webratio.units. If you have developed custom units placed in another package you just have to add another line to the file like the following
log4j.logger.com.mycompany.myunits=DEBUG, RTXLogFile, RTXErrorLogFile
StrutsLogConfig.properties
log4j.logger.com.webratio.struts=DEBUG StrutsLogFile, StrutsErrorLogFile
All the DEBUG information are written in the RTX.log and Struts.log files.
Advanced Configuration
WebRatio uses the popular log4j logging framework. For advanced configuration (such as layout configuration, file rolling, JDBC logging, ...) please refer to the log4j official site.
