Best practice logging implementation for Java — Logback

<?xml version="1.0" encoding="UTF-8"?>
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    <root level="info">
        <appender-ref ref="STDOUT"/>
Calling the logging facility from within Java code: 
private static final Logger LOG = LoggerFactory.getLogger(YourClass.class);
// is not shown because the log level is set to "info"
// is shown because the log level warn is of higher precedence than "info"
// is shown because the "info" log level has been explicitly specified"INFO"); 


Popular posts from this blog

Tuning ext4 for performance with emphasis on SSD usage

Java 8: Default Interface Implementations, The Diamond Problem, Multiple Inheritance, and Precedence

Tuning ext3 for performance without losing its data integrity potential