Difference between revisions of "PKI 10.6 Logging Improvements"

From Dogtag
Jump to: navigation, search
m (Logging Configuration)
(References)
Line 51: Line 51:
 
* [[PKI Design]]
 
* [[PKI Design]]
 
* [[Logging Frameworks]]
 
* [[Logging Frameworks]]
 +
* [https://pagure.io/dogtagpki/issue/195 Ticket #195 - Outdated logging service]

Revision as of 00:38, 30 June 2018

Overview

In PKI 10.6 the internal logging framework has been replaced with Tomcat's JULI which is based on java.util.logging.

For backward compatibility, the code using the internal logging framework should continue to work. The logging configuration in the CS.cfg should continue to work as well.

For code portability, new loggin code should be written using SLF4J API, and existing logging code should incrementally be converted to SLF4J API.

Logging Configuration

PKI server will use separate logging configuration for each subsystem:

This will be documented in this page.

Logging API

The logging framework can be used as follows:

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.netscape.certsrv.apps.CMS;

public class MyProgram {

    final static Logger logger = LoggerFactory.getLogger(MyProgram.class);

    public static void main(String[] args) {

        // using SLF4J API
        logger.info("Log message");

        // using PKI logging API
        CMS.debug("Log message");
    }
}

See also SLF4J.

References