Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
The $ExtendedLogger is interpreted as an environment variable.
$ java -cp log4j-core-2.8.jar org.apache.logging.log4j.core.tools.Generate$ExtendedLogger \
com.mycomp.ExtLogger DIAG=350 NOTICE=450 VERBOSE=550 > com/mycomp/ExtLogger.java
Error: Main method not found in class org.apache.logging.log4j.core.tools.Generate, please define the main method
The workaround is to quote the class name:
$ java -cp log4j-core-2.8.jar "org.apache.logging.log4j.core.tools.Generate$ExtendedLogger" \
com.mycomp.ExtLogger DIAG=350 NOTICE=450 VERBOSE=550 > com/mycomp/ExtLogger.java