|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.utility.Logging
public abstract class Logging
This class provides functionality to control logging via static methods.
Nested Class Summary | |
---|---|
static class |
Logging.RegexpFilterAgainst
Enumeration of possible regexp matcher targets for addLogFile(java.lang.String, java.util.logging.Level, boolean, java.util.logging.Formatter, java.lang.String, messif.utility.Logging.RegexpFilterAgainst) . |
Constructor Summary | |
---|---|
Logging()
|
Method Summary | |
---|---|
static void |
addLogFile(java.lang.String fileName,
java.util.logging.Level level,
boolean append,
boolean useSimpleFormatter)
Adds a new logging file. |
static void |
addLogFile(java.lang.String fileName,
java.util.logging.Level level,
boolean append,
boolean useSimpleFormatter,
java.lang.String regexp,
Logging.RegexpFilterAgainst regexpAgainst)
Adds a new logging file. |
static void |
addLogFile(java.lang.String fileName,
java.util.logging.Level level,
boolean append,
java.util.logging.Formatter formatter)
Adds a new logging file. |
static void |
addLogFile(java.lang.String fileName,
java.util.logging.Level level,
boolean append,
java.util.logging.Formatter formatter,
java.lang.String regexp,
Logging.RegexpFilterAgainst regexpAgainst)
Adds a new logging file. |
static java.util.logging.Level |
getLogLevel()
Get global logging level. |
protected static java.util.logging.Logger |
getRootLogger()
Returns the root (top-level) logger from the actual log manager. |
static boolean |
removeLogFile(java.lang.String fileName)
Close a log file and remove it from logging. |
static void |
setConsoleLevel(java.util.logging.Level level)
Set logging level of the console. |
static boolean |
setLogFileLevel(java.lang.String fileName,
java.util.logging.Level level)
Set logging level for an opened log file. |
static void |
setLogLevel(java.util.logging.Level level)
Set global logging level. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Logging()
Method Detail |
---|
protected static java.util.logging.Logger getRootLogger()
public static void setLogLevel(java.util.logging.Level level)
level
- New global logging levelpublic static java.util.logging.Level getLogLevel()
public static boolean setLogFileLevel(java.lang.String fileName, java.util.logging.Level level)
fileName
- the name of the log filelevel
- the new logging level to set
public static void setConsoleLevel(java.util.logging.Level level)
level
- the new logging level for consolepublic static void addLogFile(java.lang.String fileName, java.util.logging.Level level, boolean append, java.util.logging.Formatter formatter, java.lang.String regexp, Logging.RegexpFilterAgainst regexpAgainst) throws java.io.IOException
fileName
- the path of the newly opened logging file - can be absolute or relative to the current working directorylevel
- the logging level of the file - only messages with lower level will be stored in the file; can be changed by calls to setLogFileLevel(java.lang.String, java.util.logging.Level)
append
- the flag whether the target file should be truncated prior to writing (false) or notformatter
- the formatter instance that will format messages sent to the file; default formater will be used if nullregexp
- the regular expression used to filter the messages stored to this log file; if null all messages are storedregexpAgainst
- the part of the log record to match the regexp against
java.io.IOException
- if there were problems opening the filepublic static void addLogFile(java.lang.String fileName, java.util.logging.Level level, boolean append, java.util.logging.Formatter formatter) throws java.io.IOException
fileName
- the path of the newly opened logging file - can be absolute or relative to the current working directorylevel
- the logging level of the file - only messages with lower level will be stored in the file; can be changed by calls to setLogFileLevel(java.lang.String, java.util.logging.Level)
append
- the flag whether the target file should be truncated prior to writing (false) or notformatter
- the formatter instance that will format messages sent to the file; default formater will be used if null
java.io.IOException
- if there were problems opening the filepublic static void addLogFile(java.lang.String fileName, java.util.logging.Level level, boolean append, boolean useSimpleFormatter, java.lang.String regexp, Logging.RegexpFilterAgainst regexpAgainst) throws java.io.IOException
fileName
- the path of the newly opened logging file - can be absolute or relative to the current working directorylevel
- the logging level of the file - only messages with lower level will be stored in the file; can be changed by calls to setLogFileLevel(java.lang.String, java.util.logging.Level)
append
- the flag whether the target file should be truncated prior to writing (false) or notuseSimpleFormatter
- controls whether the SimpleFormatter
(if true)
or XMLFormatter
(if false) is used to format messages sent to the fileregexp
- the regular expression used to filter the messages stored to this log file; if null all messages are storedregexpAgainst
- the part of the log record to match the regexp against
java.io.IOException
- if there were problems opening the filepublic static void addLogFile(java.lang.String fileName, java.util.logging.Level level, boolean append, boolean useSimpleFormatter) throws java.io.IOException
fileName
- the path of the newly opened logging file - can be absolute or relative to the current working directorylevel
- the logging level of the file - only messages with lower level will be stored in the file; can be changed by calls to setLogFileLevel(java.lang.String, java.util.logging.Level)
append
- the flag whether the target file should be truncated prior to writing (false) or notuseSimpleFormatter
- controls whether the SimpleFormatter
(if true)
or XMLFormatter
(if false) is used to format messages sent to the file
java.io.IOException
- if there were problems opening the filepublic static boolean removeLogFile(java.lang.String fileName)
fileName
- the name of the log file to remove
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |