Package com.netscape.cms.logging
Class Logger
- java.lang.Object
-
- com.netscape.cms.logging.Logger
-
- All Implemented Interfaces:
com.netscape.certsrv.logging.ILogger
- Direct Known Subclasses:
SignedAuditLogger
public class Logger extends java.lang.Object implements com.netscape.certsrv.logging.ILogger
A class represents certificate server logger implementation.- Version:
- $Revision$, $Date$
- Author:
- thomask, mzhao
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.Hashtable<com.netscape.certsrv.logging.LogCategory,LogFactory>
mFactories
protected static Logger
mLogger
protected com.netscape.certsrv.logging.ILogQueue
mLogQueue
-
Fields inherited from interface com.netscape.certsrv.logging.ILogger
EV_AUDIT, EV_SIGNED_AUDIT, EV_SYSTEM, 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
Constructors Constructor Description Logger()
Logger(LogFactory factory, com.netscape.certsrv.logging.LogCategory category, com.netscape.certsrv.logging.LogSource source)
Logger(LogFactory factory, com.netscape.certsrv.logging.LogCategory category, com.netscape.certsrv.logging.LogSource source, int level)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.netscape.certsrv.logging.ILogEvent
create(int level, java.lang.String msg, java.lang.Object[] params, boolean multiline)
com.netscape.certsrv.logging.ILogEvent
create(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, int level, java.lang.String msg, java.lang.Object[] params, boolean multiline)
Creates generic log event.static Logger
getLogger()
get default single global loggerstatic Logger
getLogger(com.netscape.certsrv.logging.LogCategory category, com.netscape.certsrv.logging.LogSource source)
com.netscape.certsrv.logging.ILogQueue
getLogQueue()
Retrieves the associated log queue.void
log(int level, java.lang.String msg)
void
log(int level, java.lang.String msg, boolean multiline)
void
log(int level, java.lang.String msg, java.lang.Object[] params)
void
log(int level, java.lang.String msg, java.lang.Object[] params, boolean multiline)
void
log(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, int level, java.lang.String msg)
Logs an event to the log queue.void
log(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, int level, java.lang.String msg, boolean multiline)
Logs an event to the log queue.void
log(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, int level, java.lang.String msg, java.lang.Object param)
Logs an event to the log queue.void
log(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, int level, java.lang.String msg, java.lang.Object[] params)
Logs an event to the log queue.void
log(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, int level, java.lang.String msg, java.lang.Object[] params, boolean multiline)
Logs an event to the log queue.void
log(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, int level, java.lang.String msg, java.lang.Object param, boolean multiline)
Logs an event to the log queue.void
log(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, java.lang.String msg)
Logs an event using default log level.void
log(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, java.lang.String msg, boolean multiline)
Logs an event using default log level.void
log(com.netscape.certsrv.logging.LogEvent event)
void
log(java.lang.String msg)
static void
register(com.netscape.certsrv.logging.LogCategory evtClass, LogFactory f)
Registers log factory.void
release(com.netscape.certsrv.logging.ILogEvent event)
Notifies logger to reuse the event.void
update(com.netscape.certsrv.logging.LogEvent event, com.netscape.certsrv.logging.LogSource source, int level, java.lang.String message, java.lang.Object[] params, boolean multiline)
Updates a log event.
-
-
-
Field Detail
-
mLogger
protected static Logger mLogger
-
mLogQueue
protected com.netscape.certsrv.logging.ILogQueue mLogQueue
-
mFactories
protected static java.util.Hashtable<com.netscape.certsrv.logging.LogCategory,LogFactory> mFactories
-
-
Constructor Detail
-
Logger
public Logger()
-
Logger
public Logger(LogFactory factory, com.netscape.certsrv.logging.LogCategory category, com.netscape.certsrv.logging.LogSource source)
-
Logger
public Logger(LogFactory factory, com.netscape.certsrv.logging.LogCategory category, com.netscape.certsrv.logging.LogSource source, int level)
-
-
Method Detail
-
getLogger
public static Logger getLogger()
get default single global logger
-
getLogger
public static Logger getLogger(com.netscape.certsrv.logging.LogCategory category, com.netscape.certsrv.logging.LogSource source)
-
getLogQueue
public com.netscape.certsrv.logging.ILogQueue getLogQueue()
Retrieves the associated log queue.- Specified by:
getLogQueue
in interfacecom.netscape.certsrv.logging.ILogger
-
register
public static void register(com.netscape.certsrv.logging.LogCategory evtClass, LogFactory f)
Registers log factory.- Parameters:
evtClass
- the event class name: ILogger.EV_SYSTEM or ILogger.EV_AUDITf
- the event factory name
-
log
public void log(java.lang.String msg)
-
log
public void log(com.netscape.certsrv.logging.LogEvent event)
-
log
public void log(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, java.lang.String msg)
Logs an event using default log level.- Specified by:
log
in interfacecom.netscape.certsrv.logging.ILogger
- 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 logged
-
log
public void log(int level, java.lang.String msg)
-
log
public void log(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, int level, java.lang.String msg)
Logs an event to the log queue.- Specified by:
log
in interfacecom.netscape.certsrv.logging.ILogger
- 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 logged
-
log
public void log(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, int level, java.lang.String msg, java.lang.Object param)
Logs an event to the log queue.- Specified by:
log
in interfacecom.netscape.certsrv.logging.ILogger
- 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 messagelevel
- The level of the log event.
-
log
public void log(int level, java.lang.String msg, java.lang.Object[] params)
-
log
public void log(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, int level, java.lang.String msg, java.lang.Object[] params)
Logs an event to the log queue.- Specified by:
log
in interfacecom.netscape.certsrv.logging.ILogger
- 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 message
-
log
public void log(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, java.lang.String msg, boolean multiline)
Logs an event using default log level.- Specified by:
log
in interfacecom.netscape.certsrv.logging.ILogger
- 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 loggedmultiline
- true if the message has more than one line, otherwise false
-
log
public void log(int level, java.lang.String msg, boolean multiline)
-
log
public void log(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, int level, java.lang.String msg, boolean multiline)
Logs an event to the log queue.- Specified by:
log
in interfacecom.netscape.certsrv.logging.ILogger
- 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(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, int level, java.lang.String msg, java.lang.Object param, boolean multiline)
Logs an event to the log queue.- Specified by:
log
in interfacecom.netscape.certsrv.logging.ILogger
- 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
public void log(int level, java.lang.String msg, java.lang.Object[] params, boolean multiline)
-
log
public void log(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, int level, java.lang.String msg, java.lang.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
public com.netscape.certsrv.logging.ILogEvent create(int level, java.lang.String msg, java.lang.Object[] params, boolean multiline)
-
create
public com.netscape.certsrv.logging.ILogEvent create(com.netscape.certsrv.logging.LogCategory evtClass, com.netscape.certsrv.logging.LogSource source, int level, java.lang.String msg, java.lang.Object[] params, boolean multiline)
Creates generic log event. If required, we can recycle events here.- Specified by:
create
in interfacecom.netscape.certsrv.logging.ILogger
-
update
public void update(com.netscape.certsrv.logging.LogEvent event, com.netscape.certsrv.logging.LogSource source, int level, java.lang.String message, java.lang.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
public void release(com.netscape.certsrv.logging.ILogEvent event)
Notifies logger to reuse the event. This framework opens up possibility to reuse event.- Parameters:
event
- a log event
-
-