Skip to content

Instantly share code, notes, and snippets.

@ChristianOellers
Last active June 11, 2023 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChristianOellers/7b1f42de4df1ab6bab73bdb79cba2835 to your computer and use it in GitHub Desktop.
Save ChristianOellers/7b1f42de4df1ab6bab73bdb79cba2835 to your computer and use it in GitHub Desktop.
Log4j - Example implementation (Java).
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class Example {
private static final Logger logger = LoggerFactory.getLogger(Example.class);
public void doSomething() {
// Levels: info, warn, ...
logger.warn("Text", 1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment