Differences

This shows you the differences between two versions of the page.

Link to this comparison view

log4jsimple [2014/10/26 01:52] (current)
Line 1: Line 1:
 +===== Log4j Simple example =====
 +<code java>
 +// Use Log4j in a java program
 +// the file log4j.config contains
 +// log4j.config
 +// log4j.rootLogger=info,​ stdout, R
 +// log4j.logger.default=ERROR
 +//
 +// TLog.java
 +//
 +// $Id$
 +//
 +
 +import org.apache.log4j.*;​
 +
 +public class TLog
 +{
 +    private final static Logger LOGGER = Logger.getLogger("​default"​);​
 +
 +    public static void main(String[] args)
 +    {
 +        PropertyConfigurator.configure("​log4j.config"​);​
 +        LOGGER.info("​Info"​);​
 +        LOGGER.warn("​Warn"​);​
 +        LOGGER.error("​Error"​);​
 +        LOGGER.debug("​Debug"​);​
 +        LOGGER.fatal("​Fatal"​);​
 +    }
 +}
 +</​code>​
 +[[start|Back to start page]]
  
log4jsimple.txt ยท Last modified: 2014/10/26 01:52 (external edit)
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0