← Back to team overview

dhis2-devs team mailing list archive

Re: dhis lite

 

>
>
>
> I've finally got rid of all the pesky System.err.println() statements
> and am using Jetty's Log class.  Haven't figured out yet how to tie it
> in with the commons logging in the webapp and log to a file (other
> than stderr).  That's the next challenge ... priority 1.



I have changed the logging to how its done in DHIS 2. Might help, if you
don't like it go ahead and revert it.

Copying in some contents for a log4j properties file that works at least for
DHIS 2, have a look if you like, simply change rootcategory from console to
file:

-------------

# Log to file setup
log4j.appender.file = org.apache.log4j.RollingFileAppender
log4j.appender.file.File = dhis.log
log4j.appender.file.MaxFileSize = 100KB
log4j.appender.file.MaxBackupIndex = 3
log4j.appender.file.layout = org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern = * %-5p %d{ABSOLUTE} %m (%F
[%t])%n

# Log to console setup
log4j.appender.console = org.apache.log4j.ConsoleAppender
log4j.appender.console.layout = org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern = * %-5p %d{ABSOLUTE} %m (%F
[%t])%n

# Categories (order: DEBUG, INFO, WARN, ERROR, FATAL)
log4j.rootCategory = WARN, console
log4j.category.org.hisp.dhis = INFO
-----------------

Follow ups

References