Skip to content

Instantly share code, notes, and snippets.

@lucindo
Created October 18, 2016 19:26
Show Gist options
  • Save lucindo/abe9515af1cf3d40c8c50c32e91b0ca0 to your computer and use it in GitHub Desktop.
Save lucindo/abe9515af1cf3d40c8c50c32e91b0ca0 to your computer and use it in GitHub Desktop.
Quick&Dirty Log4J conf (inline)
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);
//...
}
}
@lucindo
Copy link
Author

lucindo commented Oct 18, 2016

this helps: -Dlog4j.debug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment