org.apache.logging.log4j.core.tools
Class Generate

java.lang.Object
  extended by org.apache.logging.log4j.core.tools.Generate

public final class Generate
extends Object

Generates source code for custom or extended logger wrappers.

Usage:

To generate source code for an extended logger that adds custom log levels to the existing ones:
java org.apache.logging.log4j.core.tools.Generate$ExtendedLogger <logger.class.name> <CUSTOMLEVEL>=<WEIGHT> [CUSTOMLEVEL2=WEIGHT2 [CUSTOMLEVEL3=WEIGHT3] ...]

Example of creating an extended logger:
java org.apache.logging.log4j.core.tools.Generate$ExtendedLogger com.mycomp.ExtLogger DIAG=350 NOTICE=450 VERBOSE=550

To generate source code for a custom logger that replaces the existing log levels with custom ones:
java org.apache.logging.log4j.core.tools.Generate$CustomLogger <logger.class.name> <CUSTOMLEVEL>=<WEIGHT> [CUSTOMLEVEL2=WEIGHT2 [CUSTOMLEVEL3=WEIGHT3] ...]

Example of creating a custom logger:
java org.apache.logging.log4j.core.tools.Generate$CustomLogger com.mycomp.MyLogger DEFCON1=350 DEFCON2=450 DEFCON3=550


Nested Class Summary
static class Generate.CustomLogger
          Generates source code for custom logger wrappers that only provide convenience methods for the specified custom levels, not for the standard built-in levels.
static class Generate.ExtendedLogger
          Generates source code for extended logger wrappers that provide convenience methods for the specified custom levels, and by extending org.apache.logging.log4j.spi.ExtendedLoggerWrapper, inherit the convenience methods for the built-in levels provided by the Logger interface.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Copyright © 1999-2014 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.