Package gov.usgs.util.logging
Class SimpleLogFormatter
java.lang.Object
java.util.logging.Formatter
gov.usgs.util.logging.SimpleLogFormatter
Simple(r) log formatter for java.util.logging messages.
Outputs unique dates once, with all messages sharing that time tab indented
below.
Example Format:
Wed Sep 30 19:31:48 GMT 2009 INFO Exit code=0 Wed Sep 30 19:32:52 GMT 2009 INFO [polldir] duplicate product id=urn:earthquake-usgs-gov:shakemap-scraper:global:2009medd:1 Wed Sep 30 19:32:53 GMT 2009 INFO [polldir] received urn:earthquake-usgs-gov:shakemap-scraper:global:2009medd:1 INFO [losspager] filtering type 'shakemap-scraper', not allowed INFO [logging_client] received urn:earthquake-usgs-gov:shakemap-scraper:global:2009medd:1 INFO [shakemap] received urn:earthquake-usgs-gov:shakemap-scraper:global:2009medd:1
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.SimpleLogFormatter
(boolean timestampsEnabled) Constructor with log timestamp option. -
Method Summary
Modifier and TypeMethodDescriptionfinal String
Format a LogRecord for output.Check if time stamps are currently enabled.void
setTimestampsEnabled
(Boolean timestampsEnabled) Set if timestamps are currently enabled.Methods inherited from class java.util.logging.Formatter
formatMessage, getHead, getTail
-
Field Details
-
MILLIS_PER_SECOND
public static final long MILLIS_PER_SECONDMilliseconds in a second.- See Also:
-
-
Constructor Details
-
SimpleLogFormatter
public SimpleLogFormatter()Default constructor. -
SimpleLogFormatter
public SimpleLogFormatter(boolean timestampsEnabled) Constructor with log timestamp option.- Parameters:
timestampsEnabled
- flag indicating if timestamps are included or not
-
-
Method Details
-
format
Format a LogRecord for output. -
getTimestampsEnabled
Check if time stamps are currently enabled.- Returns:
- flag indicating if timestamps are currently enabled
-
setTimestampsEnabled
Set if timestamps are currently enabled.- Parameters:
timestampsEnabled
- True to enable timestamps, false otherwise.
-