public class WatcherConfig extends Object
Watcher and WatcherData behavior.
This class exposes configurable properties that influence how the session-related logging behaves at runtime. It supports reading initial values from system properties during application startup, allowing applications to externalize configuration.
These properties should ideally be defined before invoking any method from this library, to ensure consistent behavior. Some properties can be modified dynamically at runtime, although care should be taken in concurrent environments.
This class is intended as a utility container and is not meant to be instantiated.
| Modifier and Type | Field and Description |
|---|---|
boolean |
dataEnabled
Whether the watcher writes encoded data messages to log.
|
String |
dataPrefix
Prefix added to the logger name used for encoded data messages.
|
String |
dataSuffix
Suffix added to the logger name used for encoded data messages.
|
long |
delayMilliseconds
Initial delay before the first status report by
WatcherSingleton.DEFAULT_WATCHER, in milliseconds. |
String |
messagePrefix
Prefix added to the logger name used for human-readable messages.
|
String |
messageSuffix
Suffix added to the logger name used for human-readable messages.
|
String |
name
Logger name used by
WatcherSingleton.DEFAULT_WATCHER to write messages. |
long |
periodMilliseconds
Interval between subsequent status reports by
WatcherSingleton.DEFAULT_WATCHER, in milliseconds. |
String |
PROP_DATA_ENABLED |
String |
PROP_DATA_PREFIX |
String |
PROP_DATA_SUFFIX |
String |
PROP_DELAY |
String |
PROP_MESSAGE_PREFIX |
String |
PROP_MESSAGE_SUFFIX |
String |
PROP_NAME |
String |
PROP_PERIOD |
| Constructor and Description |
|---|
WatcherConfig() |
public final String PROP_NAME
public final String PROP_DELAY
public final String PROP_PERIOD
public final String PROP_DATA_PREFIX
public final String PROP_DATA_SUFFIX
public final String PROP_DATA_ENABLED
public final String PROP_MESSAGE_PREFIX
public final String PROP_MESSAGE_SUFFIX
public String name
WatcherSingleton.DEFAULT_WATCHER to write messages.
Value is read from system property slf4jtoys.watcher.name, defaulting to "watcher".
public long delayMilliseconds
WatcherSingleton.DEFAULT_WATCHER, in milliseconds.
Value is read from system property slf4jtoys.watcher.delay, defaulting to 60000 (1 minute). The
value can be suffixed with ms, s, m, or h.
You may assign a new value at runtime, but restarting the default watcher is required for the change to take effect.
public long periodMilliseconds
WatcherSingleton.DEFAULT_WATCHER, in milliseconds.
Value is read from system property slf4jtoys.watcher.period, defaulting to 600000 (10 minutes).
The value can be suffixed with ms, s, m, or h.
You may assign a new value at runtime, but restarting the default watcher is required for the change to take effect.
public String dataPrefix
By default, encoded and human-readable messages are written to the same logger. Setting a prefix allows directing encoded data to a different logger.
Example: with prefix data., a logger a.b.c.MyClass becomes data.a.b.c.MyClass for encoded
data.
Value is read from system property slf4jtoys.watcher.data.prefix, defaulting to an empty string.
public String dataSuffix
By default, encoded and human-readable messages are written to the same logger. Setting a suffix allows directing encoded data to a different logger.
Example: with suffix .data, a logger a.b.c.MyClass becomes a.b.c.MyClass.data for encoded
data.
Value is read from system property slf4jtoys.watcher.data.suffix, defaulting to an empty string.
public boolean dataEnabled
Value is read from system property slf4jtoys.watcher.message.prefix, defaulting to false.
You may assign a new value at runtime.
public String messagePrefix
By default, encoded and human-readable messages are written to the same logger. Setting a prefix allows directing readable messages to a different logger.
Example: with prefix message., a logger a.b.c.MyClass becomes message.a.b.c.MyClass for
readable messages.
Value is read from system property slf4jtoys.watcher.message.prefix, defaulting to an empty string.
public String messageSuffix
By default, encoded and human-readable messages are written to the same logger. Setting a suffix allows directing readable messages to a different logger.
Example: with suffix .message, a logger a.b.c.MyClass becomes a.b.c.MyClass.message for
readable messages.
Value is read from system property slf4jtoys.watcher.message.suffix, defaulting to an empty string.
Copyright © 2010–2025. All rights reserved.