Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public final class Logging
- Object
- Logging
The logging configuration: per-logger levels and where lines go.
Levels come from logging.level.<name> settings, the keys Spring Boot uses.
A logger takes the level of the longest name that is it or a package above
it, and logging.level.root (INFO when unset) covers everything else:
logging.level.root=WARN
logging.level.com.example=INFO
logging.level.com.example.push=DEBUG
The server applies its configuration when it starts; setLevel(String, Level)
changes one at run time, and every logger sees the change on its next line.
Fields
public static final String LEVEL_PREFIX = "logging.level." | The prefix of the per-logger level settings. |
Methods
public static void configure(Config config)
throws IOException | Reads every logging.level.* setting of config, replacing the levels set before. |
public static void setLevel(String logger, Level level) | Sets the level of logger and every logger under it; null clears a level set before. |
public static void setSink(LogSink sink) | Sends every line to sink from now on; null restores standard output. |
Inherited methods
Field details
LEVEL_PREFIX
public static final String LEVEL_PREFIX = "logging.level."The prefix of the per-logger level settings.
Method details
configure
public static void configure(Config config)
throws IOExceptionReads every
logging.level.* setting of config, replacing the levels
set before. Called by the server when it starts.Throws
IOException- when a setting names no level
setLevel
public static void setLevel(String logger, Level level)Sets the level of
logger and every logger under it; null clears a level
set before. "root" is the level of everything else.setSink
public static void setSink(LogSink sink)Sends every line to
sink from now on; null restores standard output.