public class Logging extends Object
The call back is provided as an interface that needs to be implemented. The
method
Logging.Callback.onMessage(long, Level, Datetime, String, String) is
called when a message that needs logging is available. Callback is only
called for messages that have 'level' higher than or equal to the
'defaultThresholdLevel'. There can be only one callback that can be
registered and if another callback is registered it will replace the previous
one.
Logging.Callback cb = new Logging.Callback() {
public void onMessage(
long threadId,
Level level,
Datetime dateTime,
String loggerName,
String message) {
// Do some processing
}
};
Logging.registerCallback(cb, Level.WARNING);
| Modifier and Type | Class and Description |
|---|---|
static interface |
Logging.Callback
An interface for a callback that can been registered to get the log messages
|
| Constructor and Description |
|---|
Logging() |
| Modifier and Type | Method and Description |
|---|---|
static void |
deregisterCallback()
deregister the callback
|
static void |
logTestMessage(Level level)
log a test message at the specified 'level'.
|
static void |
registerCallback(Logging.Callback callback,
Level defaultThresholdlevel)
register a callback with the specified 'level' as default threshold level
|
public static void registerCallback(Logging.Callback callback, Level defaultThresholdlevel)
public static void deregisterCallback()
public static void logTestMessage(Level level)
Copyright © 2021 Bloomberg L.P.. All rights reserved.