Package com.luciad.util.logging
Class TLcdJULSimpleFormatter
java.lang.Object
java.util.logging.Formatter
com.luciad.util.logging.TLcdJULSimpleFormatter
A formatter for
LogRecord
messages. The following properties of a
LogRecord
are used as the argument list to the
String.format(String, Object...)
method:
-
LogRecord.getMessage()
-
LogRecord.getLoggerName()
-
LogRecord.getLevel()
-
LogRecord.getMillis()
as a Date object -
LogRecord.getSourceClassName()
-
LogRecord.getSourceMethodName()
-
LogRecord.getThreadID()
-
LogRecord.getThrown()
com.luciad.util.logging.TLcdJULSimpleFormatter.format
in the
Java logging properties file.
When the LogRecord contains a Throwable object the corresponding stack trace
is also logged immediately after the message. To disable logging of the stack
trace you can set the property
com.luciad.util.logging.TLcdJULSimpleFormatter.logStackTrace
to false
For example, the following two configuration lines:
java.util.logging.ConsoleHandler.formatter = com.luciad.util.logging.TLcdJULSimpleFormatter
com.luciad.util.logging.TLcdJULSimpleFormatter.format = %3$s: %1$s (%8$s)\n
com.luciad.util.logging.TLcdJULSimpleFormatter.logStackTrace = false
may display a log message as
"SEVERE: An exception occurred (ArrayIndexOutOfBoundsException)"
.
It will not display the stack trace.- Since:
- 9.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the log format string.boolean
Returns true if the stack of Throwable objects is logged, false otherwise.void
Sets the log format stringvoid
setLogStackTrace
(boolean aLogStackTrace) Sets the value of the logStackTrace property.Methods inherited from class java.util.logging.Formatter
formatMessage, getHead, getTail
-
Constructor Details
-
TLcdJULSimpleFormatter
public TLcdJULSimpleFormatter()Default constructor.
-
-
Method Details
-
getFormat
Returns the log format string.- Returns:
- the format string.
-
setFormat
Sets the log format string- Parameters:
aFormat
- the format string
-
format
-
isLogStackTrace
public boolean isLogStackTrace()Returns true if the stack of Throwable objects is logged, false otherwise.- Returns:
- true if the stack of Throwable objects is logged, false otherwise.
-
setLogStackTrace
public void setLogStackTrace(boolean aLogStackTrace) Sets the value of the logStackTrace property.- Parameters:
aLogStackTrace
- if true (default), stack traces are logged.
-