|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ls.service.log.LoggerFactory
Factory class for the ones who implements ILogger. This has also required public static methods for global log path and system information.
Field Summary | |
static byte |
LARS
The type of the log will be LARS |
static byte |
LOG4J
The type of the log will be LOG4J |
Constructor Summary | |
LoggerFactory()
|
Method Summary | |
static void |
addSystemErrorLog(ISystemErrorLog systemErrorLog)
configures the LoggerFactory to use an additional system error log implementation |
static void |
clearSystemErrorLogs()
removes all configured system error log implementations |
static byte |
getCodeOfLogType(String logTypeValue)
Converts string name of the logger to the byte value, if the value is empty or it is null the defaultLogType of is return. |
static byte |
getDefaultLogType()
returns the default log type |
static String |
getGlobalLogPath()
Returns the path where the logfiles, that are not addressed via an absolute path, will be written. |
static ILogger |
getInstance()
returns an instance of ILogger, that is the defaut type of logger specified by the variable |
static ILogger |
getInstance(byte logType)
returns an instance of ILogger according to the parameter, in case the creation of the logger specified by the parameter fails try to create the the logger with the type of 'LARS', if this fails than it is thrown an BaseRuntimeException. |
static ILogger |
getInstance(byte logType,
String logFileName,
int logLevel,
Map map)
returns an instance of ILogger according to the parameters, in case the creation of the logger specified by the logType fails try to create the the logger with the type of 'LARS', if this fails than it is thrown an BaseRuntimeException. |
static ILogger |
getInstance(byte logType,
String logFileName,
Map map)
returns an instance of ILogger according to the parameters, in case the creation of the logger specified by the logType fails try to create the the logger with the type of 'LARS', if this fails than it is thrown an BaseRuntimeException. |
static ILogger |
getInstance(byte logType,
String logFileName,
String logLevel,
Map map)
returns an instance of ILogger according to the parameters, in case the creation of the logger specified by the logType fails try to create the the logger with the type of 'LARS', if this fails than it is thrown an BaseRuntimeException. |
static String |
getStringOfLogType(byte logTypeValue)
Converts byte value of the logger to the string name |
static Set |
getSystemErrorLogNames()
gets the name of all configured system error log implementations |
static Set |
getSystemErrorLogSet()
gets the system error local set variable |
static void |
setDefaultLogType(byte newLogType)
sets the default log type of the logger to the value specified as a parameter |
static void |
setGlobalLogPath(String path)
Sets the path where the log files, that are not addressed via an absolute path, will be written. |
static int |
translateLogLevel(String logLevel)
translates a log level from a String to an int |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte LARS
public static final byte LOG4J
Constructor Detail |
public LoggerFactory()
Method Detail |
public static ILogger getInstance() throws BaseRuntimeException
BaseRuntimeException
- If after the failure of creation of ILogger with the specifed log type and
after it try, also, the creation of the ILogger wht the type=LARSgetInstance(byte)
public static ILogger getInstance(byte logType) throws BaseRuntimeException
logType
- requested logging mechanism (LARS
or LOG4J
)BaseRuntimeException
- If after the failure of creation of ILogger with the specifed log type and
after it try, also, the creation of the ILogger wht the type=LARSpublic static ILogger getInstance(byte logType, String logFileName, Map map) throws BaseRuntimeException
logType
- requested logging mechanism (LARS
or LOG4J
)logFileName
- name of the log filemap
- a Map containing variable/value pairs needed for variable substitution in log file names
(e.g. for exchanging $A with the agent's name)BaseRuntimeException
- If after the failure of creation of ILogger with the specifed log type and
after it try, also, the creation of the ILogger wht the type=LARSpublic static ILogger getInstance(byte logType, String logFileName, int logLevel, Map map) throws BaseRuntimeException
logType
- requested logging mechanism (LARS
or LOG4J
)logFileName
- name of the log filelogLevel
- determines which messages should be loggedmap
- a Map containing variable/value pairs needed for variable substitution in log file names
(e.g. for exchanging $A with the agent's name)BaseRuntimeException
- If after the failure of creation of ILogger with the specifed log type and
after it try, also, the creation of the ILogger wht the type=LARSpublic static ILogger getInstance(byte logType, String logFileName, String logLevel, Map map) throws BaseRuntimeException
logType
- requested logging mechanism (LARS
or LOG4J
)logFileName
- Name of the log filelogLevel
- determines which messages should be logged (name of one of the defined constants
(e.g. "error"), case is ignored)map
- a Map containing variable/value pairs needed for variable substitution in log file names
(e.g. for exchanging $A with the agent's name)BaseRuntimeException
- If after the failure of creation of ILogger with the specifed log type and
after it try, also, the creation of the ILogger wht the type=LARSgetInstance(byte,String,int,Map)
public static int translateLogLevel(String logLevel) throws LogException
logLevel
- name of one of the defined constants (e.g. "error"), case is ignoredLogException
- If given log level is null or unknownpublic static void setGlobalLogPath(String path) throws ProgrammingException
path
- log file pathProgrammingException
- If global log path was already set beforepublic static String getGlobalLogPath()
public static void addSystemErrorLog(ISystemErrorLog systemErrorLog)
systemErrorLog
- additional system error log implementationILogger.logSystemInformation()
public static void clearSystemErrorLogs()
ILogger.logSystemInformation()
public static Set getSystemErrorLogNames()
ILogger.logSystemInformation()
public static Set getSystemErrorLogSet()
public static byte getDefaultLogType()
public static void setDefaultLogType(byte newLogType)
newLogType
- the new log typepublic static byte getCodeOfLogType(String logTypeValue) throws LogException
logTypeValue
- the string value of the log typeLogException
- If not a valid log typepublic static String getStringOfLogType(byte logTypeValue) throws LogException
logTypeValue
- the byte value of the log typeLogException
- If not a valid log type
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |