Package org.jfree.base.log
Class LogConfiguration
- java.lang.Object
-
- org.jfree.base.log.LogConfiguration
-
public class LogConfiguration extends java.lang.ObjectA log configuration class. This implementation is a simple frontend to the global configuration.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDISABLE_LOGGINGThe 'disable logging' property key.static java.lang.StringDISABLE_LOGGING_DEFAULTThe default 'disable logging' property value.static java.lang.StringLOGLEVELThe 'log level' property key.static java.lang.StringLOGLEVEL_DEFAULTThe default 'log level' property value.static java.lang.StringLOGTARGETThe 'log target' property key.static java.lang.StringLOGTARGET_DEFAULTThe default 'log target' property value.
-
Constructor Summary
Constructors Modifier Constructor Description privateLogConfiguration()Default constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetLogLevel()Returns the log level.static java.lang.StringgetLogTarget()Returns the current log target.static booleanisDisableLogging()Returnstrueif logging is disabled, andfalseotherwise.static voidsetDisableLogging(boolean disableLogging)Sets the flag that disables logging.static voidsetLogLevel(java.lang.String level)Sets the log level, which is read from the global report configuration at the point that the classloader loads theLogclass.static voidsetLogTarget(java.lang.String logTarget)Sets the log target.
-
-
-
Field Detail
-
DISABLE_LOGGING_DEFAULT
public static final java.lang.String DISABLE_LOGGING_DEFAULT
The default 'disable logging' property value.- See Also:
- Constant Field Values
-
LOGLEVEL
public static final java.lang.String LOGLEVEL
The 'log level' property key.- See Also:
- Constant Field Values
-
LOGLEVEL_DEFAULT
public static final java.lang.String LOGLEVEL_DEFAULT
The default 'log level' property value.- See Also:
- Constant Field Values
-
LOGTARGET
public static final java.lang.String LOGTARGET
The 'log target' property key.- See Also:
- Constant Field Values
-
LOGTARGET_DEFAULT
public static final java.lang.String LOGTARGET_DEFAULT
The default 'log target' property value.
-
DISABLE_LOGGING
public static final java.lang.String DISABLE_LOGGING
The 'disable logging' property key.- See Also:
- Constant Field Values
-
-
Method Detail
-
getLogTarget
public static java.lang.String getLogTarget()
Returns the current log target.- Returns:
- the log target.
-
setLogTarget
public static void setLogTarget(java.lang.String logTarget)
Sets the log target.- Parameters:
logTarget- the new log target.
-
getLogLevel
public static java.lang.String getLogLevel()
Returns the log level.- Returns:
- the log level.
-
setLogLevel
public static void setLogLevel(java.lang.String level)
Sets the log level, which is read from the global report configuration at the point that the classloader loads theLogclass.Valid log levels are:
"Error"- error messages;"Warn"- warning messages;"Info"- information messages;"Debug"- debug messages;
- the setting is not case sensitive.
- changing the log level after the
Logclass has been loaded will have no effect. - to turn of logging altogether, use the
setDisableLogging(boolean)method.
- Parameters:
level- the new log level.
-
isDisableLogging
public static boolean isDisableLogging()
Returnstrueif logging is disabled, andfalseotherwise.- Returns:
- true, if logging is completly disabled, false otherwise.
-
setDisableLogging
public static void setDisableLogging(boolean disableLogging)
Sets the flag that disables logging.To switch off logging globally, you can use the following code:
ReportConfiguration.getGlobalConfig().setDisableLogging(true);- Parameters:
disableLogging- the flag.
-
-