diff options
Diffstat (limited to 'pki/base/common/src/com/netscape/certsrv/logging/ILogger.java')
-rw-r--r-- | pki/base/common/src/com/netscape/certsrv/logging/ILogger.java | 257 |
1 files changed, 108 insertions, 149 deletions
diff --git a/pki/base/common/src/com/netscape/certsrv/logging/ILogger.java b/pki/base/common/src/com/netscape/certsrv/logging/ILogger.java index 8f64e78e3..01fbc6b93 100644 --- a/pki/base/common/src/com/netscape/certsrv/logging/ILogger.java +++ b/pki/base/common/src/com/netscape/certsrv/logging/ILogger.java @@ -17,22 +17,23 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.logging; + import java.util.Properties; + /** - * An interface represents a logger for certificate server. This object is used - * to issue log messages for the various types of logging event types. A log - * message results in a ILogEvent being created. This event is then placed on a - * ILogQueue to be ultimately written to the destination log file. This object - * also maintains a collection of ILogFactory objects which are used to create - * the supported types of ILogEvents. CMS comes out of the box with three event - * types: "signedAudit", "system", and "audit". - * + * An interface represents a logger for certificate server. This object is used to + * issue log messages for the various types of logging event types. A log message results + * in a ILogEvent being created. This event is then placed on a ILogQueue to be ultimately + * written to the destination log file. This object also maintains a collection of ILogFactory objects + * which are used to create the supported types of ILogEvents. CMS comes out of the box with three event + * types: "signedAudit", "system", and "audit". + * * @version $Revision$, $Date$ */ public interface ILogger { - - // List of defined log classes. + + //List of defined log classes. /** * log class: audit event. */ @@ -40,24 +41,24 @@ public interface ILogger { public static final String PROP_AUDIT = "transaction"; /** - * log class: system event. System event with log level >= LL_FAILURE will - * also be logged in error log + * log class: system event. + * System event with log level >= LL_FAILURE will also be logged in error log */ public static final int EV_SYSTEM = 1; public static final String PROP_SYSTEM = "system"; /** - * log class: SignedAudit event. + * log class: SignedAudit event. */ public static final int EV_SIGNED_AUDIT = 2; public static final String PROP_SIGNED_AUDIT = "signedAudit"; - // List of defined log sources. - + //List of defined log sources. + /** * log source: used by servlet to retrieve all logs */ - public static final int S_ALL = 0; // used by servlet only + public static final int S_ALL = 0; //used by servlet only /** * log source: identify the log entry is from KRA @@ -135,29 +136,30 @@ public interface ILogger { */ public static final int S_TKS = 16; - + /** - * log source: identify the log entry is from other subsystem eg. policy, - * security, connector,registration + * log source: identify the log entry is from other subsystem + * eg. policy, security, connector,registration */ public static final int S_OTHER = 20; + // List of defined log levels. /** * log level: used by servlet to retrieve all level logs */ - public static final int LL_ALL = -1; // used by servlet only - public static final String LL_ALL_STRING = "All"; // used by servlet only + public static final int LL_ALL = -1; //used by servlet only + public static final String LL_ALL_STRING = "All"; //used by servlet only /** * log level: indicate this log entry is debug info */ - + /** - * Debug level is depreciated since CMS6.1. Please use CMS.debug() to output - * messages to debugging file. + * Debug level is depreciated since CMS6.1. Please use + * CMS.debug() to output messages to debugging file. */ - public static final int LL_DEBUG = 0; // depreciated + public static final int LL_DEBUG = 0; // depreciated public static final String LL_DEBUG_STRING = "Debug"; /** @@ -197,20 +199,20 @@ public interface ILogger { public static final String LL_SECURITY_STRING = "Security"; /** - * "SubjectID" for system-initiated events logged in signed audit log - * messages + * "SubjectID" for system-initiated events logged + * in signed audit log messages */ public static final String SYSTEM_UID = "$System$"; /** - * A constant string value used to denote a single "unknown" identity in - * signed audit log messages + * A constant string value used to denote a single "unknown" identity + * in signed audit log messages */ public static final String UNIDENTIFIED = "$Unidentified$"; /** - * A constant string value used to denote a single "non-role" identity in - * signed audit log messages + * A constant string value used to denote a single "non-role" identity + * in signed audit log messages */ public static final String NONROLEUSER = "$NonRoleUser$"; @@ -219,22 +221,23 @@ public interface ILogger { */ public static final String SUCCESS = "Success"; public static final String FAILURE = "Failure"; - + /** - * A constant string value used to denote a "non-applicable" data value in - * signed audit log messages + * A constant string value used to denote a "non-applicable" + * data value in signed audit log messages */ public final static String SIGNED_AUDIT_NON_APPLICABLE = "N/A"; /** - * A constant string value used to denote an "empty", or "null", data value - * in signed audit log messages + * A constant string value used to denote an "empty", or "null", + * data value in signed audit log messages */ public final static String SIGNED_AUDIT_EMPTY_VALUE = "<null>"; /** - * Constant string values associated with the type of certificate processing - * stored in the "InfoName" field in certain signed audit log messages + * Constant string values associated with the type of certificate + * processing stored in the "InfoName" field in certain signed + * audit log messages */ public final static String SIGNED_AUDIT_ACCEPTANCE = "certificate"; public final static String SIGNED_AUDIT_CANCELLATION = "cancelReason"; @@ -255,7 +258,7 @@ public interface ILogger { * NT event type: correspont to log level LL_FAILURE and above */ public static final int NT_ERROR = 1; - + // List of defined log multiline attribute. /** * indicate the log message has more than one line @@ -269,9 +272,8 @@ public interface ILogger { /** * Logs an event to the log queue. - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. + * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param source The source of the log event. * @param msg The detail message to be logged. */ @@ -279,9 +281,8 @@ public interface ILogger { /** * Logs an event to the log queue. - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. + * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param props The resource bundle used for the detailed message. * @param source The source of the log event. * @param msg The detail message to be logged. @@ -290,9 +291,8 @@ public interface ILogger { /** * Logs an event to the log queue. - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. + * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param source The source of the log event. * @param level The level of the log event. * @param msg The detail message to be logged. @@ -301,226 +301,185 @@ public interface ILogger { /** * Logs an event to the log queue. - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. + * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param props The resource bundle used for the detailed message. * @param source The source of the log event. * @param level The level of the log event. * @param msg The detail message to be logged. */ - public void log(int evtClass, Properties props, int source, int level, - String msg); + public void log(int evtClass, Properties props, int source, int level, String msg); /** * Logs an event to the log queue. - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. + * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param source The source of the log event. * @param level The level of the log event. * @param msg The detail message to be logged. * @param param The parameter in the detail message. */ - public void log(int evtClass, int source, int level, String msg, - Object param); + public void log(int evtClass, int source, int level, String msg, Object param); /** * Logs an event to the log queue. - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. + * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param source The source of the log event. * @param level The level of the log event. * @param msg The detail message to be logged. * @param params The parameters in the detail message. */ - public void log(int evtClass, int source, int level, String msg, - Object params[]); + public void log(int evtClass, int source, int level, String msg, Object params[]); /** * Logs an event to the log queue. - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. + * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param props The resource bundle used for the detailed message. * @param source The source of the log event. * @param msg The detail message to be logged. * @param param The parameters in the detail message. */ - public void log(int evtClass, Properties props, int source, String msg, - Object param); + public void log(int evtClass, Properties props, int source, String msg, Object param); /** * Logs an event to the log queue. - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. + * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param props The resource bundle used for the detailed message. * @param source The source of the log event. * @param level The level of the log event. * @param msg The detail message to be logged. * @param param The parameter in the detail message. */ - public void log(int evtClass, Properties props, int source, int level, - String msg, Object param); + public void log(int evtClass, Properties props, int source, int level, String msg, + Object param); /** * Logs an event to the log queue. - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. + * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param prop The resource bundle used for the detailed message. * @param source The source of the log event. * @param level The level of the log event. * @param msg The detail message to be logged. * @param params The parameters in the detail message. */ - public void log(int evtClass, Properties prop, int source, int level, - String msg, Object params[]); + public void log(int evtClass, Properties prop, int source, int level, String msg, + Object params[]); - // multiline log + //multiline log /** * Logs an event to the log queue. - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. + * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param source The source of the log event. * @param msg The detail message to be logged. - * @param multiline true If the message has more than one line, otherwise - * false. + * @param multiline true If the message has more than one line, otherwise false. */ public void log(int evtClass, int source, String msg, boolean multiline); /** * Logs an event to the log queue. - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. + * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param props The resource bundle used for the detailed message. * @param source The source of the log event. * @param msg The detail message to be logged. - * @param multiline True if the message has more than one line, otherwise - * false. + * @param multiline True if the message has more than one line, otherwise false. */ - public void log(int evtClass, Properties props, int source, String msg, - boolean multiline); + public void log(int evtClass, Properties props, int source, String msg, boolean multiline); /** * Logs an event to the log queue. - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. + * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param source The source of the log event. * @param level The level of the log event. * @param msg The detail message to be logged. - * @param multiline True if the message has more than one line, otherwise - * false. + * @param multiline True if the message has more than one line, otherwise false. */ - public void log(int evtClass, int source, int level, String msg, - boolean multiline); + public void log(int evtClass, int source, int level, String msg, boolean multiline); /** * Logs an event to the log queue. - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. + * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param props The resource bundle used for the detailed message. * @param source The source of the log event. * @param level The level of the log event. * @param msg The detail message to be logged. - * @param multiline True if the message has more than one line, otherwise - * false. + * @param multiline True if the message has more than one line, otherwise false. */ - public void log(int evtClass, Properties props, int source, int level, - String msg, boolean multiline); + public void log(int evtClass, Properties props, int source, int level, String msg, boolean multiline); /** * Logs an event to the log queue. - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. + * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param source The source of the log event. * @param level The level of the log event. * @param msg The detail message to be logged. * @param param The parameter in the detail message. - * @param multiline True if the message has more than one line, otherwise - * false. + * @param multiline True if the message has more than one line, otherwise false. */ - public void log(int evtClass, int source, int level, String msg, - Object param, boolean multiline); + public void log(int evtClass, int source, int level, String msg, Object param, boolean multiline); /** * Logs an event to the log queue. - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. + * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param props The resource bundle used for the detailed message. * @param source TTTTsource of the log event. * @param msg The detail message to be logged. * @param param The parameter in the detail message. - * @param multiline True if the message has more than one line, otherwise - * false. + * @param multiline True if the message has more than one line, otherwise false. */ - public void log(int evtClass, Properties props, int source, String msg, - Object param, boolean multiline); + public void log(int evtClass, Properties props, int source, String msg, Object param, boolean multiline); /** * Logs an event to the log queue. - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. + * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param props The resource bundle used for the detailed message. * @param source The source of the log event. * @param level The level of the log event. * @param msg The detail message to be logged. * @param param The parameter in the detail message. - * @param multiline True if the message has more than one line, otherwise - * false. + * @param multiline True if the message has more than one line, otherwise false. */ - public void log(int evtClass, Properties props, int source, int level, - String msg, Object param, boolean multiline); + public void log(int evtClass, Properties props, int source, int level, String msg, + Object param, boolean multiline); /** * Logs an event to the log queue. - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. + * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param prop The resource bundle used for the detailed message. * @param source The source of the log event. * @param level The level of the log event. * @param msg The detail message to be logged. * @param params The parameters in the detail message. - * @param multiline True if the message has more than one line, otherwise - * false. + * @param multiline True if the message has more than one line, otherwise false. */ - public void log(int evtClass, Properties prop, int source, int level, - String msg, Object params[], boolean multiline); + public void log(int evtClass, Properties prop, int source, int level, String msg, + Object params[], boolean multiline); /* * Generates an ILogEvent - * - * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or - * EV_SIGNED_AUDIT. - * + * @param evtClass What kind of event it is: EV_AUDIT or EV_SYSTEM or EV_SIGNED_AUDIT. * @param props The resource bundle used for the detailed message. - * * @param source The source of the log event. - * * @param level The level of the log event. - * * @param msg The detail message to be logged. - * * @param params The parameters in the detail message. - * - * @param multiline True if the message has more than one line, otherwise - * false. - * + * @param multiline True if the message has more than one line, otherwise false. * @return ILogEvent, a log event. */ - public ILogEvent create(int evtClass, Properties prop, int source, - int level, String msg, Object params[], boolean multiline); + public ILogEvent create(int evtClass, Properties prop, int source, int level, + String msg, Object params[], boolean multiline); /** * Register a log event factory. Which will create the desired ILogEvents. @@ -528,8 +487,8 @@ public interface ILogger { public void register(int evtClass, ILogEventFactory f); /** - * Retrieves the associated log queue. The log queue is where issued log - * events are collected for later processing. + * Retrieves the associated log queue. The log queue is where issued log events + * are collected for later processing. */ public ILogQueue getLogQueue(); |