|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.logging.PrintStreamLogger
public class PrintStreamLogger
This logger supports simple output to a print stream. By default that print stream is stdout. But it can changed by setting the property 'logging.printstream.file' to a filename. Then it will open that file at first access and appends all output to it.
The initial log level is ERROR. It can be changed via the property 'logging.level' (e.g. logging.level=WARNING).
| Field Summary | |
|---|---|
static int |
LEVEL_DEBUG
This log level specifies that all messages will be logged |
static int |
LEVEL_ERROR
This log level specifies that only error messages will be logged |
static int |
LEVEL_INFO
This log level specifies that only error, warning and info messages will be logged |
static int |
LEVEL_NONE
This log level specifies that no message at all will be logged |
static int |
LEVEL_WARN
This log level specifies that only error and warning messages will be logged |
static java.lang.String |
LL_DEBUG
This is the log level string representation for DEBUG |
static java.lang.String |
LL_ERROR
This is the log level string representation for ERROR |
static java.lang.String |
LL_INFO
This is the log level string representation for INFO |
static java.lang.String |
LL_NONE
This is the log level string representation for NONE |
static java.lang.String |
LL_WARNING
This is the log level string representation for WARNING |
static java.lang.String |
PROP_LOG_LEVEL
The property to set the log level. |
static java.lang.String |
PROP_OUTPUT_FILE
The property that specifies a filename to redirect the log output "logging.printstream.file" |
| Constructor Summary | |
|---|---|
PrintStreamLogger()
Initialize the new instance with default values. |
|
| Method Summary | |
|---|---|
int |
getLogLevel()
Returns the current log level |
void |
initialize(java.util.Properties properties)
Initialize the logger from the given properties settings. |
boolean |
isLoggingDebugs()
Returns true, if debug messages will be written to the output device(s). |
boolean |
isLoggingErrors()
Returns true, if errors will be written to the output device(s). |
boolean |
isLoggingInfos()
Returns true, if info messages will be written to the output device(s). |
boolean |
isLoggingWarnings()
Returns true, if warnings will be written to the output device(s). |
void |
logDebug(java.lang.String message)
If the logging level is DEBUG the given message will be written to the log output device(s). |
void |
logError(java.lang.String message)
If the logging level is DEBUG, INFO, WARNING or ERROR the given message will be written to the log output device(s). |
void |
logError(java.lang.String message,
java.lang.Throwable exception)
If the logging level is DEBUG, INFO, WARNING or ERROR the given message and the exception will be written to the log output device(s). |
void |
logException(java.lang.Throwable ex)
Writes the given exception to the log output device(s). |
void |
logInfo(java.lang.String message)
If the logging level is INFO or DEBUG the given message will be written to the log output device(s). |
void |
logWarning(java.lang.String message)
If the logging level is DEBUG, INFO or WARNING the given message will be written to the log output device(s). |
void |
logWarning(java.lang.String message,
java.lang.Throwable exception)
If the logging level is DEBUG, INFO or WARNING the given message and the exception will be written to the log output device(s). |
void |
setLogLevel(int newLevel)
Set the current log level of this logger. |
boolean |
setLogLevel(java.lang.String logLevel)
Changes the log level to the specified level. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int LEVEL_NONE
public static final int LEVEL_ERROR
public static final int LEVEL_WARN
public static final int LEVEL_INFO
public static final int LEVEL_DEBUG
public static final java.lang.String LL_NONE
public static final java.lang.String LL_ERROR
public static final java.lang.String LL_WARNING
public static final java.lang.String LL_INFO
public static final java.lang.String LL_DEBUG
public static final java.lang.String PROP_OUTPUT_FILE
"logging.printstream.file"
public static final java.lang.String PROP_LOG_LEVEL
"logging.level"
| Constructor Detail |
|---|
public PrintStreamLogger()
| Method Detail |
|---|
public int getLogLevel()
public void setLogLevel(int newLevel)
newLevel - The new log level (i.e. one of the LEVEL_ constants of this class)public void initialize(java.util.Properties properties)
initialize in interface Loggerpublic void logException(java.lang.Throwable ex)
logException in interface Loggerpublic void logDebug(java.lang.String message)
logDebug in interface Loggerpublic void logInfo(java.lang.String message)
logInfo in interface Loggerpublic void logWarning(java.lang.String message)
logWarning in interface Loggerpublic void logError(java.lang.String message)
logError in interface Logger
public void logWarning(java.lang.String message,
java.lang.Throwable exception)
logWarning in interface Logger
public void logError(java.lang.String message,
java.lang.Throwable exception)
logError in interface Loggerpublic boolean isLoggingDebugs()
isLoggingDebugs in interface Loggerpublic boolean isLoggingInfos()
isLoggingInfos in interface Loggerpublic boolean isLoggingWarnings()
isLoggingWarnings in interface Loggerpublic boolean isLoggingErrors()
isLoggingErrors in interface Loggerpublic boolean setLogLevel(java.lang.String logLevel)
setLogLevel in interface Logger
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||