Last updated by admin 3 years ago
?????? {excerpt:hidden=true}Configuring Logging {excerpt}
Grails uses Apache Commons Logging, defaulting to Log4J for the log output and configuration.Grails????????????Apache Commons?Logging????????Log4J???????To configure Log4j open the "web-app/WEB-INF/log4j.properties" file and configure it to log the required output. It is worthwhile reading the Log4j docs to understand how to do so.Log4j????????????"web-app/WEB-INF/log4j.properties"????????????????????????????????????????Log4j???????????????????????????????? {excerpt:hidden=true}Per-controller logs {excerpt}
Within controllers you can use the "log" property supplied by Grails to log using standard commons logging methods. You can configure the logging of each controller individually by editing log4j.properties as follows:log4j.logger.YourController=debug, stdoutWhere YourController is the name of your controller class.??????????commons???????????????????Grails?????"log"???????????????????????log4j.properties???????????????????????????????????????????:log4j.logger.YourController=debug, stdout????YourController????????????????????Hibernate????Log4J??????? {excerpt:hidden=true}Log4j Hibernate Output {excerpt}
{excerpt:hidden=true}To log all SQL queries and all the stuff hibernate does, add the line {excerpt} hibernate????????????????????????log4j.logger.org.hibernate=debug, stdout
tmp/war/WEB-INF



