Package com.netscape.cms.logging
Class Logger
java.lang.Object
com.netscape.cms.logging.Logger
- All Implemented Interfaces:
ILogger
- Direct Known Subclasses:
SignedAuditLogger
A class represents certificate server logger
implementation.
- Version:
- $Revision$, $Date$
- Author:
- thomask, mzhao
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static Hashtable<LogCategory,
LogFactory> protected static Logger
protected LogQueue
Fields inherited from interface com.netscape.certsrv.logging.ILogger
EV_AUDIT, EV_SIGNED_AUDIT, FAILURE, L_MULTILINE, L_SINGLELINE, LL_ALL, LL_ALL_STRING, LL_CATASTRPHE, LL_CATASTRPHE_STRING, LL_DEBUG, LL_DEBUG_STRING, LL_FAILURE, LL_FAILURE_STRING, LL_INFO, LL_INFO_STRING, LL_MISCONF, LL_MISCONF_STRING, LL_SECURITY, LL_SECURITY_STRING, LL_WARN, LL_WARN_STRING, NONROLEUSER, NT_ERROR, NT_INFO, NT_WARN, PROP_AUDIT, PROP_SIGNED_AUDIT, PROP_SYSTEM, S_ACLS, S_ADMIN, S_ALL, S_AUTHENTICATION, S_AUTHORIZATION, S_CA, S_DB, S_HTTP, S_KRA, S_LDAP, S_OCSP, S_OTHER, S_RA, S_REQQUEUE, S_SIGNED_AUDIT, S_TKS, S_TPS, S_USRGRP, S_XCERT, SIGNED_AUDIT_ACCEPTANCE, SIGNED_AUDIT_CANCELLATION, SIGNED_AUDIT_EMPTY_VALUE, SIGNED_AUDIT_NON_APPLICABLE, SIGNED_AUDIT_REJECTION, SUCCESS, SYSTEM_UID, UNIDENTIFIED
-
Constructor Summary
ConstructorsConstructorDescriptionLogger()
Logger
(LogFactory factory, LogCategory category, LogSource source) Logger
(LogFactory factory, LogCategory category, LogSource source, int level) -
Method Summary
Modifier and TypeMethodDescriptioncreate
(LogCategory evtClass, LogSource source, int level, String msg, Object[] params, boolean multiline) Creates generic log event.static Logger
get default single global loggerstatic Logger
getLogger
(LogCategory category, LogSource source) Retrieves the associated log queue.void
void
void
void
void
log
(LogCategory evtClass, LogSource source, int level, String msg) Logs an event to the log queue.void
log
(LogCategory evtClass, LogSource source, int level, String msg, boolean multiline) Logs an event to the log queue.void
log
(LogCategory evtClass, LogSource source, int level, String msg, Object param) Logs an event to the log queue.void
log
(LogCategory evtClass, LogSource source, int level, String msg, Object[] params) Logs an event to the log queue.void
log
(LogCategory evtClass, LogSource source, int level, String msg, Object[] params, boolean multiline) Logs an event to the log queue.void
log
(LogCategory evtClass, LogSource source, int level, String msg, Object param, boolean multiline) Logs an event to the log queue.void
log
(LogCategory evtClass, LogSource source, String msg) Logs an event using default log level.void
log
(LogCategory evtClass, LogSource source, String msg, boolean multiline) Logs an event using default log level.void
void
static void
register
(LogCategory evtClass, LogFactory f) Registers log factory.void
Notifies logger to reuse the event.void
update
(LogEvent event, LogSource source, int level, String message, Object[] params, boolean multiline) Updates a log event.
-
Field Details
-
mLogger
-
mLogQueue
-
mFactories
-
-
Constructor Details
-
Logger
public Logger() -
Logger
-
Logger
-
-
Method Details
-
getLogger
get default single global logger -
getLogger
-
getLogQueue
Retrieves the associated log queue.- Specified by:
getLogQueue
in interfaceILogger
-
register
Registers log factory.- Parameters:
evtClass
- the event class name: ILogger.EV_SYSTEM or ILogger.EV_AUDITf
- the event factory name
-
log
-
log
-
log
Logs an event using default log level. -
log
-
log
Logs an event to the log queue. -
log
Logs an event to the log queue. -
log
-
log
Logs an event to the log queue. -
log
Logs an event using default log level. -
log
-
log
Logs an event to the log queue.- Specified by:
log
in interfaceILogger
- Parameters:
evtClass
- What kind of event it is: EV_AUDIT or EV_SYSTEM.source
- the source of the log eventlevel
- the level of the log eventmsg
- the one line detail message to be loggedmultiline
- true if the message has more than one line, otherwise false
-
log
public void log(LogCategory evtClass, LogSource source, int level, String msg, Object param, boolean multiline) Logs an event to the log queue.- Specified by:
log
in interfaceILogger
- Parameters:
evtClass
- What kind of event it is: EV_AUDIT or EV_SYSTEM.source
- the source of the log eventmsg
- the one line detail message to be loggedparam
- the parameter in the detail messagemultiline
- true if the message has more than one line, otherwise falselevel
- The level of the log event.
-
log
-
log
public void log(LogCategory evtClass, LogSource source, int level, String msg, Object[] params, boolean multiline) Logs an event to the log queue.- Parameters:
evtClass
- What kind of event it is: EV_AUDIT or EV_SYSTEM.source
- the source of the log eventlevel
- the level of the log eventmsg
- the one line detail message to be loggedparams
- the parameters in the detail messagemultiline
- true if the message has more than one line, otherwise false
-
create
-
create
public ILogEvent create(LogCategory evtClass, LogSource source, int level, String msg, Object[] params, boolean multiline) Creates generic log event. If required, we can recycle events here. -
update
public void update(LogEvent event, LogSource source, int level, String message, Object[] params, boolean multiline) Updates a log event.- Parameters:
event
- The event to be updated.source
- The subsystem who creates the log event.level
- The severity of the log event.message
- The detail message of the log.params
- The parameters in the detail log message.multiline
- The log message has more than one line or not.
-
release
Notifies logger to reuse the event. This framework opens up possibility to reuse event.- Parameters:
event
- a log event
-