public class Logger extends java.lang.Object implements ILogger
Modifier and Type | Field and Description |
---|---|
protected static java.util.Hashtable<LogCategory,LogFactory> |
mFactories |
protected static Logger |
mLogger |
protected ILogQueue |
mLogQueue |
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 and Description |
---|
Logger() |
Logger(LogFactory factory,
LogCategory category,
LogSource source) |
Logger(LogFactory factory,
LogCategory category,
LogSource source,
int level) |
Modifier and Type | Method and Description |
---|---|
ILogEvent |
create(int level,
java.lang.String msg,
java.lang.Object[] params,
boolean multiline) |
ILogEvent |
create(LogCategory evtClass,
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 logger
|
static Logger |
getLogger(LogCategory category,
LogSource source) |
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(LogCategory evtClass,
LogSource source,
int level,
java.lang.String msg)
Logs an event to the log queue.
|
void |
log(LogCategory evtClass,
LogSource source,
int level,
java.lang.String msg,
boolean multiline)
Logs an event to the log queue.
|
void |
log(LogCategory evtClass,
LogSource source,
int level,
java.lang.String msg,
java.lang.Object param)
Logs an event to the log queue.
|
void |
log(LogCategory evtClass,
LogSource source,
int level,
java.lang.String msg,
java.lang.Object[] params)
Logs an event to the log queue.
|
void |
log(LogCategory evtClass,
LogSource source,
int level,
java.lang.String msg,
java.lang.Object[] params,
boolean multiline)
Logs an event to the log queue.
|
void |
log(LogCategory evtClass,
LogSource source,
int level,
java.lang.String msg,
java.lang.Object param,
boolean multiline)
Logs an event to the log queue.
|
void |
log(LogCategory evtClass,
LogSource source,
java.lang.String msg)
Logs an event using default log level.
|
void |
log(LogCategory evtClass,
LogSource source,
java.lang.String msg,
boolean multiline)
Logs an event using default log level.
|
void |
log(LogEvent event) |
void |
log(java.lang.String msg) |
static void |
register(LogCategory evtClass,
LogFactory f)
Registers log factory.
|
void |
release(ILogEvent event)
Notifies logger to reuse the event.
|
void |
update(LogEvent event,
LogSource source,
int level,
java.lang.String message,
java.lang.Object[] params,
boolean multiline)
Updates a log event.
|
protected static Logger mLogger
protected ILogQueue mLogQueue
protected static java.util.Hashtable<LogCategory,LogFactory> mFactories
public Logger()
public Logger(LogFactory factory, LogCategory category, LogSource source)
public Logger(LogFactory factory, LogCategory category, LogSource source, int level)
public static Logger getLogger()
public static Logger getLogger(LogCategory category, LogSource source)
public ILogQueue getLogQueue()
getLogQueue
in interface ILogger
public static void register(LogCategory evtClass, LogFactory f)
evtClass
- the event class name: ILogger.EV_SYSTEM or ILogger.EV_AUDITf
- the event factory namepublic void log(java.lang.String msg)
public void log(LogEvent event)
public void log(LogCategory evtClass, LogSource source, java.lang.String msg)
public void log(int level, java.lang.String msg)
public void log(LogCategory evtClass, LogSource source, int level, java.lang.String msg)
public void log(LogCategory evtClass, LogSource source, int level, java.lang.String msg, java.lang.Object param)
public void log(int level, java.lang.String msg, java.lang.Object[] params)
public void log(LogCategory evtClass, LogSource source, int level, java.lang.String msg, java.lang.Object[] params)
public void log(LogCategory evtClass, LogSource source, java.lang.String msg, boolean multiline)
public void log(int level, java.lang.String msg, boolean multiline)
public void log(LogCategory evtClass, LogSource source, int level, java.lang.String msg, boolean multiline)
log
in interface ILogger
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 falsepublic void log(LogCategory evtClass, LogSource source, int level, java.lang.String msg, java.lang.Object param, boolean multiline)
log
in interface ILogger
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.public void log(int level, java.lang.String msg, java.lang.Object[] params, boolean multiline)
public void log(LogCategory evtClass, LogSource source, int level, java.lang.String msg, java.lang.Object[] params, boolean multiline)
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 falsepublic ILogEvent create(int level, java.lang.String msg, java.lang.Object[] params, boolean multiline)
public ILogEvent create(LogCategory evtClass, LogSource source, int level, java.lang.String msg, java.lang.Object[] params, boolean multiline)
public void update(LogEvent event, LogSource source, int level, java.lang.String message, java.lang.Object[] params, boolean multiline)
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.public void release(ILogEvent event)
event
- a log event