Skip to content

jboss-logging/jboss-logging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

355 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

JBoss Logging

JBoss Logging is a logging facade which can bind to different log managers allowing your applications to be log manager agnostic.

Usage

JBoss Logging is similar to other logging facades in the way you get a logger and log messages. One thing to note is the format style log methods will only format the message if the log level is enabled. This helps with performance of objects which may have complex toString() methods.

private static final Logger LOGGER = Logger.getLogger(Customer.class);

public Customer getCustomer(final int id) {
    LOGGER.debugf("Looking up customer %d", id);
    try {
        final Customer customer = findCustomer(id);
        LOGGER.tracef("Found customer: %s", customer);
        return customer;
    } catch (Exception e) {
        LOGGER.errorf(e, "Error looking up customer %d", id);
    }
    return null;
}

Supported Log Managers

The following are the supported log managers and listed in the order the attempt to discover the provider is done.

  1. JBoss Log Manager

  2. Log4j 2

  3. SLF4J and Logback

  4. log4j (note this log manager is EOL’d)

  5. Java Util Logging

You can define the specific log manager you want to use by specifying the org.jboss.logging.provider system property. The following is the mapping of the property value to the log manager.

Property Value Log Manager

jboss

JBoss Log Manager

jdk

Java Util Logging

log4j2

Log4j 2

log4j

log4j

slf4j

SLF4J and Logback

Custom Provider

You can also implement your own org.jboss.logging.LoggerProvider which would be loaded from a ServiceLoader. Simply implement the API and add a META-INF/services/org.jboss.logging.LoggerProvider file with the fully qualified class name of your implementation to your library. If the system property is not defined, your implementation should be discovered.

Maven Dependency

<dependency>
    <groupId>org.jboss.logging</groupId>
    <artifactId>jboss-logging</artifactId>
    <version>${version.org.jboss.logging}</version>
</dependency>

Contributing

Releasing

Releasing the project requires permission to deploy to Maven Central see Maven Central Release Requirements. Once everything is setup, you simply need to run the ./release.sh script. There are two required parameters:

  1. -r or --release which is the version you want to release

  2. -d or --development which is the next development version.

By default, the release version cannot contain SNAPSHOT and the development version, must contain SNAPSHOT.

Example Command
./release.sh -r 1.0.0.Final -d 1.0.1.Final-SNAPSHOT

Supported Arguments

Argument Requires Value Description

-d, --development

Yes

The next version for the development cycle.

-f, --force

No

Forces to allow a SNAPSHOT suffix in release version and not require one for the development version.

-h, --help

N/A

Displays this help

--notes-start-tag

Unused

Passes the --notes-from-tag and the argument to the gh create release command.

-p, --prerelease

Unused

Passes the --prerelease to the gh create release command.

-r, --release

Yes

The version to be released. Also used for the tag.

--dry-run

No

Executes the release in as a dry-run. Nothing will be updated or pushed.

-v, --verbose

No

Prints verbose output.

Any additional arguments are considered arguments for the Maven command.

About

JBoss Logging

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors