Mercurial > projects > ldc
view tango/example/logging/multilog.d @ 270:d9d5d59873d8 trunk
[svn r291] Fixed a bunch of the old Phobos tests to work with Tango.
Branch statements now emit a new block after it.
Fixed the _adSort runtime function had a bad signature.
Added a missing dot prefix on compiler generated string tables for string switch.
Fixed, PTRSIZE seems like it was wrong on 64bit, now it definitely gets set properly.
author | lindquist |
---|---|
date | Mon, 16 Jun 2008 16:01:19 +0200 |
parents | 1700239cab2e |
children |
line wrap: on
line source
import tango.util.log.Log; import tango.util.log.Log4Layout; import tango.util.log.FileAppender; import tango.util.log.ConsoleAppender; import tango.util.log.RollingFileAppender; /******************************************************************************* Shows how to setup multiple appenders on logging tree *******************************************************************************/ void main () { // set default logging level at the root auto log = Log.getRootLogger; log.setLevel (log.Level.Trace); // 10 logs, all with 10 mbs each log.addAppender (new RollingFileAppender("rolling.log", 9, 1024*1024*10)); // a single file appender, with an XML layout log.addAppender (new FileAppender ("single.log", new Log4Layout)); // console appender log.addAppender (new ConsoleAppender); // log to all log.trace ("three-way logging"); }