Created
October 18, 2016 19:26
-
-
Save lucindo/abe9515af1cf3d40c8c50c32e91b0ca0 to your computer and use it in GitHub Desktop.
Quick&Dirty Log4J conf (inline)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Properties; | |
import org.apache.log4j.PropertyConfigurator; | |
class MyDummyApp { | |
public static void main(String []args) { | |
Properties properties=new Properties(); | |
properties.setProperty("log4j.rootLogger","DEBUG,stdout"); | |
properties.setProperty("log4j.rootCategory","DEBUG"); | |
properties.setProperty("log4j.appender.stdout", "org.apache.log4j.ConsoleAppender"); | |
properties.setProperty("log4j.appender.stdout.layout", "org.apache.log4j.PatternLayout"); | |
properties.setProperty("log4j.appender.stdout.layout.ConversionPattern","%d{yyyy/MM/dd HH:mm:ss.SSS} [%5p] %t (%F) - %m%n"); | |
PropertyConfigurator.configure(properties); | |
//... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this helps: -Dlog4j.debug