Is there documentation anywhere on how logging works in Spring.
You can look at the JavaDocs and samples. You can set it up in your web.xml:
Code:
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>
I'm using the JdbcTemplate and trying to get all of the SQL queries outputted to the stdout
You can try something like:
Code:
#Spring JdbcTemplate logging
log4j.logger.org.springframework.jdbc.core.JdbcTemplate=DEBUG, springlogfile
log4j.appender.springlogfile=org.apache.log4j.RollingFileAppender
log4j.appender.springlogfile.File=${webapp.root}/WEB-INF/springJdbcTemplate.log
log4j.appender.springlogfile.MaxFileSize=10MB
# Keep three backup files
log4j.appender.springlogfile.MaxBackupIndex=3
log4j.appender.springlogfile.layout=org.apache.log4j.PatternLayout
# Pattern to output: date priority [category] - <message>line_separator
log4j.appender.springlogfile.layout.ConversionPattern=%d %p [%c] - <%m>%n