Package org.jfree.base.log
Class LogConfiguration
java.lang.Object
org.jfree.base.log.LogConfiguration
A log configuration class. This implementation is a simple frontend
to the global configuration.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The 'disable logging' property key.static final String
The default 'disable logging' property value.static final String
The 'log level' property key.static final String
The default 'log level' property value.static final String
The 'log target' property key.static final String
The default 'log target' property value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Returns the log level.static String
Returns the current log target.static boolean
Returnstrue
if logging is disabled, andfalse
otherwise.static void
setDisableLogging
(boolean disableLogging) Sets the flag that disables logging.static void
setLogLevel
(String level) Sets the log level, which is read from the global report configuration at the point that the classloader loads theLog
class.static void
setLogTarget
(String logTarget) Sets the log target.
-
Field Details
-
DISABLE_LOGGING_DEFAULT
The default 'disable logging' property value.- See Also:
-
LOGLEVEL
The 'log level' property key.- See Also:
-
LOGLEVEL_DEFAULT
The default 'log level' property value.- See Also:
-
LOGTARGET
The 'log target' property key.- See Also:
-
LOGTARGET_DEFAULT
The default 'log target' property value. -
DISABLE_LOGGING
The 'disable logging' property key.- See Also:
-
-
Constructor Details
-
LogConfiguration
private LogConfiguration()Default constructor.
-
-
Method Details
-
getLogTarget
Returns the current log target.- Returns:
- the log target.
-
setLogTarget
Sets the log target.- Parameters:
logTarget
- the new log target.
-
getLogLevel
Returns the log level.- Returns:
- the log level.
-
setLogLevel
Sets the log level, which is read from the global report configuration at the point that the classloader loads theLog
class.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
Log
class 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()Returnstrue
if logging is disabled, andfalse
otherwise.- 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.
-