SLF4J Documentation

repository·master·Indexed 25 days ago

https://github.com/qos-ch/slf4j

A logging facade for Java that provides a standardized API to decouple application code from specific logging implementations such as Logback, Log4j, java.util.logging, and tinylog. Includes details on the SLF4J Migrator GUI and output destination configuration for SLF4J Simple.

Tokens
506
Snippets
1
Records
5
Agent score
32%

What's inside SLF4J

  1. What is SLF4J?

    master
    The Simple Logging Facade for Java (SLF4J) is an abstraction layer for various logging frameworks. It allows developers to write code against a stable API, while the actual logging implementation (e.g., logback, log4j 2.x, java.util.logging, tinylog, etc.) is plugged in at deployment time. This decoupling ensures that your application code is not tightly bound to a specific logging library.
  2. Get support for SLF4J

    master

    If you encounter problems, use the following channels for support:

    Note: Do not email SLF4J developers directly; using public channels allows other knowledgeable users to assist you.

  3. Configure output destinations in SLF4J Simple

    master

    SLF4J Simple allows users to select where log messages are sent via the OutputChoiceType. The available output types are:

    • SYS_OUT: Directs output to System.out.
    • SYS_ERR: Directs output to System.err.
    • CACHED_SYS_OUT: Uses a cached reference to System.out.
    • CACHED_SYS_ERR: Uses a cached reference to System.err.
    • FILE: Directs output to a specific PrintStream (e.g., a file).
    enum OutputChoiceType {
        SYS_OUT, CACHED_SYS_OUT, SYS_ERR, CACHED_SYS_ERR, FILE;
    }