public class SessionConfig extends Object
Watcher, WatcherData, Meter,
and MeterData.
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.
Security note: These configuration parameters may influence logging output. Avoid using untrusted input when modifying runtime values, as it could cause unintended exposure or log format manipulation.
This class is a utility holder and should not be instantiated.
| Modifier and Type | Field and Description |
|---|---|
String |
charset
Character encoding used when printing logs or performing string operations related to session behavior.
|
String |
PROP_PRINT_CHARSET |
String |
PROP_PRINT_UUID_SIZE |
int |
UUID_LENGTH
The number of hexadecimal characters in a full UUID, without separators.
|
int |
uuidSize
|
| Constructor and Description |
|---|
SessionConfig() |
| Modifier and Type | Method and Description |
|---|---|
void |
init()
Initializes the configurable properties of the SessionConfig class.
|
void |
reset()
Resets the configuration properties to their default values.
|
public final String PROP_PRINT_UUID_SIZE
public final String PROP_PRINT_CHARSET
public final int UUID_LENGTH
public int uuidSize
Watcher and Meter.
The full UUID (32 hex digits) uniquely identifies the application instance. In most cases, a shorter prefix (e.g., 5 digits) is sufficient to distinguish between instances or nodes.
0, the UUID will not be printed.UUID_LENGTH, it will be truncated.
Default value: 5
Can be initialized via system property slf4jtoys.session.print.uuid.size.
public String charset
Defaults to StandardCharsets.UTF_8. May be changed at runtime.
public void init()
public void reset()
Copyright © 2010–2025. All rights reserved.