Class ExtensionsLog
java.lang.Object
net.sf.basedb.util.extensions.logging.ExtensionsLog
Instances hold the log entries for a single extension.
- Since:
- 3.19.8
- Author:
- nicklas
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private final String
private boolean
private final ReadWriteLock
private static Map<String,
ExtensionsLog> private int
private int
private int
private int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) void
Add a log entry.void
clearLog()
Clear the log.Create a logger that adds messages to this log.static ExtensionsLogger
createLogger
(String extensionId) Create a logger that can add entries to the log for the given extension.Get the extension id of the log.static ExtensionsLog
Get the service log for the given extension.Get an iterator that is returning all entries in the log.static ExtensionsLogger
Get a logger that can add entries to the log for the given extension.int
Get the max number of entries to keep in the log.int
Get the current number of entries in the log.int
Get the current number of error entries in the log.int
Get the current number of warning entries in the log.boolean
Are log entries copied to standard output?boolean
Is the debug-level enabled?void
setCopyToStdout
(boolean copyToStdout) Enable or disable copies of log entries to standard output.void
setDebugEnabled
(boolean debugEnabled) Enable or disable debug-level logging.
-
Field Details
-
logs
-
extensionId
-
logEntries
-
lock
-
maxEntries
private int maxEntries -
numEntries
private volatile int numEntries -
numWarnings
private volatile int numWarnings -
numErrors
private volatile int numErrors -
isDebugEnabled
private boolean isDebugEnabled -
copyToStdout
private boolean copyToStdout
-
-
Constructor Details
-
ExtensionsLog
-
-
Method Details
-
getLog
Get the service log for the given extension. If the log doens't exists yet it can optionally be created. -
getLogger
Get a logger that can add entries to the log for the given extension. If the log doesn't exists yet, it can optionally be created. -
createLogger
Create a logger that can add entries to the log for the given extension. If the log doesn't exists yet, it is be created. -
getExtensionId
Get the extension id of the log. -
isDebugEnabled
public boolean isDebugEnabled()Is the debug-level enabled? -
setDebugEnabled
public void setDebugEnabled(boolean debugEnabled) Enable or disable debug-level logging. -
isCopyingToStdout
public boolean isCopyingToStdout()Are log entries copied to standard output? -
setCopyToStdout
public void setCopyToStdout(boolean copyToStdout) Enable or disable copies of log entries to standard output. When enabled, TRACE-level log entries are also written if debugging is enabled. -
getMaxEntries
public int getMaxEntries()Get the max number of entries to keep in the log. -
getNumEntries
public int getNumEntries()Get the current number of entries in the log. -
getNumWarnings
public int getNumWarnings()Get the current number of warning entries in the log. -
getNumErrors
public int getNumErrors()Get the current number of error entries in the log. -
clearLog
public void clearLog()Clear the log. -
createLogger
Create a logger that adds messages to this log. -
add
Add a log entry. DEBUG level messages are skipped unless debug-level is enabled. TRACE level messages are always skipped but can be written to standard output if that option and debugging is enabled. -
getLogEntries
Get an iterator that is returning all entries in the log. The returned iterator is read-only and theIterator.remove()
method will throw an exception.
-