PKI 10.6 Logging Improvements

From Dogtag
Revision as of 00:55, 30 June 2018 by Mharmsen (talk | contribs) (References)

Jump to: navigation, search


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"Log message");

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

See also SLF4J.