Difference between revisions of "PKI 10.6 Logging Improvements"
From Dogtag
(→References) |
(→References) |
||
Line 52: | Line 52: | ||
* [[Logging Frameworks]] | * [[Logging Frameworks]] | ||
* [https://pagure.io/dogtagpki/issue/195 Ticket #195 - Outdated logging service] | * [https://pagure.io/dogtagpki/issue/195 Ticket #195 - Outdated logging service] | ||
+ | * [https://pagure.io/dogtagpki/issue/814 Ticket #814 - Provide log rotation for PKI debug logs] |
Revision as of 00:55, 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:
- Global logging.properties
- CA logging.properties
- KRA logging.properties
- OCSP logging.properties
- TKS logging.properties
- TPS logging.properties
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.