Default log4j.properties file

I have a problem - I always forget how to initialize Log4 module.

So, I always do some googling and always land at the same page: Short introduction to Log4j.

To save some time, here is example configuration for log4j.properties:

log4j.rootLogger=TRACE, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout

# Print the date in ISO 8601 format
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

# Print only messages of level DEBUG or above in the package com.foo.
log4j.logger.org.springframework=DEBUG

Example output:

2013-12-16 13:28:23,990 [MSC service thread 1-4] INFO  org.springframework.security.config.http.DefaultFilterChainValidator - Checking whether login URL '/login.do' is accessible with your configuration
Kategorija: 

Komentuoti