Skip to content

PKI 10.6 Logging Improvements

Endi S. Dewata edited this page Mar 30, 2022 · 2 revisions

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 logging 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 PKI 10.6 Server Logging.

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.

See Also

Clone this wiki locally