Skip to content

Instantly share code, notes, and snippets.

@jonas-grgt
Last active February 7, 2019 13:40
Show Gist options
  • Save jonas-grgt/b941051c44da0124e00be10800436b5e to your computer and use it in GitHub Desktop.
Save jonas-grgt/b941051c44da0124e00be10800436b5e to your computer and use it in GitHub Desktop.
import org.apache.log4j.*;
public class LogClass {
private static org.apache.log4j.Logger log = Logger.getLogger(LogClass.class);
public static void main(String[] args) {
log.setLevel(Level.WARN);
log.trace("Trace Message!");
log.debug("Debug Message!");
log.info("Info Message!"); <-- not this or any of the above lines
log.warn("Warn Message!"); <-- will log this line
log.error("Error Message!"); <-- and this
log.fatal("Fatal Message!"); <-- and this
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment