public abstract class CentralLogger
extends java.lang.Object
There is a specific order of invoking the logger methods in the app lifecycle.
First line in each driver should be setMode(Mode) to enable the proper type instantiation in
get(String, boolean, boolean), proper actions on shutdown and context description in messages.
Both server and client loggers use the same formatter. The static method
CentralLogFormatter.describeContext(Integer, String, boolean) enhances each message before it's
stored as a LogRecord, marking where it comes from (the server or the client).
Initialization is the second necessary step in the logger lifecycle. It sets the configs for the operation of the loggers and is different on the client and the server. It sets the root logger's level, based on which log messages are filtered out or saved.
Before configs are read from directory and client bootstrap and initialization kicks in, all logs are stored in-memory in a pre-init buffer. On initialization they can be filtered out based on the logger level and further handled.
The base functionality of logging and the interface is shared between the server, client and default
fallback subclasses. The difference is in the implementation of the abstract method
publish(ContextLogRecord).
The client can operate in two modes - CentralLogger.Mode.CLIENT and CentralLogger.Mode.CLIENT_STANDALONE, where the
first one is sending logs to the server to be saved to files, while the second one writes log files by
itself.
With mode CentralLogger.Mode.CLIENT all log records are stored in an in-memory data structure, pulled from the
client state synchronizer and added to the sync messages to the server. Before the session is
terminated, one last rpc call is made to the server through the service CentralLogService to
flush the leftover logs, see CentralLoggerClient.finish().
On the server the log records are stored in an in-memory data structure before initialization and after that saved to a file using FileHandler. The file gets rotated based on directory configs for size and count. Its location and name prefix can also be configured.
The client and server loggers lifecycle ends with a call to handleShutDown(). If an unexpected
event occurs during the execution and the loggers don't complete work normally, on JVM shutdown any
leftover logs are saved to a crash log file in the client / server / spawner launch directory.
CentralLogger provides also some backwards compatibility methods (e.g.
generate(String, Object...)), originally from LogHelper, and methods providing
additional logging, that do parsing from System.err streams.
| Modifier and Type | Class and Description |
|---|---|
static class |
CentralLogger.MdcVar
The slf4j MDC keys.
|
static class |
CentralLogger.Mode
The mode of logger operation.
|
static class |
CentralLogger.Slf4jKey
The slf4j keys.
|
| Modifier and Type | Field and Description |
|---|---|
private static BootstrapConfig |
bc
The bootstrap config reader.
|
private boolean |
checkParentLevels
Flag for the instanced logger to prevent recursion in class loaders.
|
(package private) static java.lang.String |
DEFAULT_CLIENT_LOG_FILE_NAME
The default name for client log files.
|
static int |
DEFAULT_FILE_COUNT
The default max number of log files before overwrite.
|
static int |
DEFAULT_FILE_LIMIT_BYTES
The default log file size in bytes.
|
(package private) static java.util.logging.Level |
DEFAULT_ROOT_LEVEL
The default root logger level for server processes.
|
(package private) static java.lang.String |
DEFAULT_SERVER_LOG_FILE_NAME
The default name for server log files.
|
private boolean |
excludeSMContext
Flag to prevent deadlock on SecurityManager.
|
(package private) static java.util.concurrent.atomic.AtomicBoolean |
IS_LOGGER_WORK_FINISHED
Flag to indicate if the logger has flushed all logs on client shutdown / termination.
|
private static java.util.Map<java.util.logging.Level,org.slf4j.event.Level> |
JUL_TO_SLF4J_LEVEL_MAP
Map between the java log levels and their corresponding sfl4j api counterparts.
|
static java.lang.String |
JVM_ARG_ENABLE_SLF4j_API
The name of the JVM arg used to disable FWD's implementation of slf4j and make the logger switch
writing from files to slf4j api.
|
private java.util.logging.Level |
level
The instanced logger level.
|
private static java.util.Map<java.lang.String,java.util.logging.Level> |
LOGGER_LEVEL_MAP
Thread-safe map to store explicitly set log levels as logger name : log level pairs.
|
private java.lang.String |
loggerName
The instanced logger name.
|
private static java.util.Set<java.lang.ref.WeakReference<CentralLogger>> |
LOGGERS
Set of references to all instantiated loggers.
|
private static java.util.Map<java.lang.String,java.lang.String> |
mdcBaseContextMap
Volatile map with the slf4j MDC base context for the process.
|
private static java.lang.ThreadLocal<java.lang.Boolean> |
mdcInitialized
Thread local field to mark if the slf4j MDC context has been initialized.
|
static int |
MIN_FILE_COUNT
The minimum allowed number of log files before overwrite.
|
static int |
MIN_FILE_LIMIT_BYTES
The minimum allowed log file size in bytes.
|
private static CentralLogger.Mode |
mode
The logger mode.
|
private static java.lang.Object |
MODE_LOCK
Lock for synchronizing setting and getting the logger mode.
|
private static java.util.Queue<ContextLogRecord> |
PRE_INIT_LOG_BUFFER
Thread-safe queue to store logs before logger initialization.
|
private static java.lang.String |
ROOT_LOGGER_NAME
The name of the root logger.
|
private org.slf4j.Logger |
slf4jLogger
Slf4j API logger.
|
private static java.util.Set<java.lang.ref.WeakReference<java.lang.Thread>> |
STREAM_LOGGING_THREADS
Collection of WeakReferences to logger threads for parsing streams.
|
static boolean |
WRITE_TO_SLF4J_API
Indicates if the loggers should use slf4j api instead of writing to FileHandler.
|
| Constructor and Description |
|---|
CentralLogger(java.lang.String loggerName,
java.util.logging.Level level,
boolean checkParentLevels,
boolean excludeSMContext)
Package-private constructor for CentralLogger.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) static void |
addToPreInitBuffer(ContextLogRecord lr)
Adds a new log record to the pre-init buffer.
|
void |
all(java.lang.String msg)
Logs a new message with log level
Level.ALL. |
private boolean |
canLog(java.util.logging.Level level,
java.lang.String msg)
Checks if a message with the provided level can be logged.
|
(package private) static void |
completePreInitWork(java.util.Map<java.lang.String,java.util.logging.Level> nameLevelMap,
java.util.logging.Level rootLevel)
Called on client / server logger initialization after the global log level is resolved from the
configs.
|
void |
config(java.lang.String msg)
Logs a new message with log level
Level.CONFIG. |
private static void |
createCrashLogFile(CentralLogger.Mode loggerMode,
java.util.List<ContextLogRecord> preInitLogBuffer,
java.util.List<java.util.logging.LogRecord> leftoverLogs)
Creates a crash log file in the working directory, dumping all remaining logs.
|
boolean |
equals(java.lang.Object o)
Checks if the argument object represents the same logger, identified by its name and level.
|
(package private) static java.util.logging.Level |
findLevel(java.lang.String loggerName,
boolean checkParentLevels)
Returns the level applying to the logger.
|
void |
fine(java.lang.String msg)
Logs a new message with log level
Level.FINE. |
void |
fine(java.util.function.Supplier<java.lang.String> msgSupplier)
Logs a new message with log level
Level.FINE. |
void |
finer(java.lang.String msg)
Logs a new message with log level
Level.FINER. |
void |
finest(java.lang.String msg)
Logs a new message with log level
Level.FINEST. |
static java.lang.String |
generate(java.lang.String spec,
java.lang.Object... params)
Consider deprecated and don't use in future development.
|
static CentralLogger |
get(java.lang.Class<?> clazz)
Returns a new instance of the CentralLogger for the source class, while preserving its attributes,
i.e.
|
static CentralLogger |
get(java.lang.String loggerName)
Returns a new instance of the CentralLogger for the name, while preserving the corresponding logger
attributes, i.e.
|
static CentralLogger |
get(java.lang.String loggerName,
boolean checkParentLevels,
boolean excludeSMContext)
Returns a new instance of the CentralLogger for the name, while preserving the corresponding logger
attributes, i.e.
|
java.util.logging.Level |
getExplicitLevel()
Returns the level explicitly set for this logger.
|
java.util.logging.Level |
getLevel()
Getter for the logger level.
|
(package private) static java.util.Map<java.lang.String,java.util.logging.Level> |
getLoggerLevelMap()
Return the unmodifiable map of the logger name : logger level.
|
java.lang.String |
getLoggerName()
Getter for the logger name.
|
(package private) static CentralLogger.Mode |
getMode()
Static getter for the logger mode in the JVM.
|
(package private) static java.util.logging.Level |
getRootLevel()
Return the root logger level.
|
(package private) static org.slf4j.spi.LoggingEventBuilder |
getSlf4jLogBuilder(org.slf4j.Logger slf4jLogger,
java.util.logging.LogRecord logRecord)
Creates a slf4j event builder, reads the java log record and sets the necessary properties.
|
static void |
handleShutDown()
The method is called as a last resort from different points in the app execution to notify
CentralLogger to complete work:
a.
|
int |
hashCode()
Returns the hash of the fields (loggerName and level) uniquely identifying a logger.
|
private static boolean |
hasParentClassLoader()
Checks if there is a ClassLoader instance in the current thread stacktrace.
|
void |
info(java.lang.String msg)
Logs a new message with log level
Level.INFO. |
void |
info(java.lang.String msg,
java.lang.Throwable t)
Logs a new message with log level
Level.INFO. |
static void |
initializeClient(CentralLoggerClientConfig config)
Initializer for clients.
|
private static void |
invalidateLoggerTreeLevelCache(java.lang.String loggerName)
Invalidates the local cache of the current logger and all its children.
|
boolean |
isCheckParentLevels()
Getter for the flag indicating if the log level can be determined by checking the parent loggers.
|
static boolean |
isClient()
Return if running in client
|
boolean |
isExcludeSMContext()
Getter for the excludeSMContext preventing deadlock on SecurityManager.
|
boolean |
isLoggable(java.util.logging.Level logLevel)
Returns if the msg level is loggable by the logger, that is true when the log msg level is the same
or bigger than the logger level.
|
private static void |
listenForShutDown()
Creates a new thread to listen for the JVM shutdown event and attaches it to the Runtime hook.
|
private void |
log(ContextLogRecord logRecord)
Logs a new log record.
|
void |
log(java.util.logging.Level level,
java.lang.String msg)
Logs a new message.
|
void |
log(java.util.logging.Level level,
java.lang.String msgFormat,
java.lang.Object... params)
Logs a new message.
|
void |
log(java.util.logging.Level level,
java.lang.String msg,
java.lang.Throwable t)
Logs a new message.
|
void |
log(java.util.logging.Level level,
java.util.function.Supplier<java.lang.String> msgSupplier)
Logs a new message.
|
void |
log(java.util.logging.Level level,
java.lang.Throwable t,
java.lang.String msgFormat,
java.lang.Object... params)
Logs a new message.
|
void |
logp(java.util.logging.Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String msg)
Logs a new message.
|
void |
logp(java.util.logging.Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String msg,
java.lang.Throwable t)
Logs a new message.
|
static void |
logStream(java.io.InputStream inputStream,
java.lang.String loggerName,
java.util.logging.Level loggerLevel,
java.util.logging.Level recordLevel,
java.util.concurrent.atomic.AtomicBoolean isProcessRunning)
A generic method for logging streams (e.g.
|
(package private) void |
logToSlf4j(ContextLogRecord logRecord,
boolean isServer,
boolean isServerSideLogging)
Log the java log record.
|
private static java.util.Optional<java.util.logging.Level> |
parseRecordLevel(java.lang.String msg)
Finds the log level in texts of the format `LEVEL: msg`.
|
protected abstract void |
publish(ContextLogRecord logRecord)
Publishes a log record, different for each version of CentralLogger.
|
private static void |
publishPreInitBuffer()
Writes all messages from the pre-init buffer with their respective loggers.
|
static void |
setBootstrapConfig(BootstrapConfig bc)
Sets the config reader.
|
(package private) static java.util.logging.FileHandler |
setFileHandler(boolean isRotationDisabled,
java.lang.String filePath,
int rotationLimit,
int rotationCount,
java.util.logging.Formatter formatter)
Executed once in the process on initialization.
|
void |
setLevel(java.util.logging.Level level)
Setter for the logger level.
|
static void |
setLevels(CentralLoggerClientConfig loggerLevels)
Invalidates the current logger levels and sets the new values.
|
static void |
setMode(CentralLogger.Mode mode)
Setter for the logger mode.
|
void |
severe(java.lang.String msg)
Logs a new message with log level
Level.SEVERE. |
void |
severe(java.lang.String msg,
java.lang.Throwable t)
Logs a new message with log level
Level.SEVERE. |
private void |
ultimateLog(java.util.logging.Level level,
java.lang.Throwable t,
java.lang.String sourceClass,
java.lang.String sourceMethod,
ContextLogRecord.LogContext context,
java.lang.String msg,
java.lang.Object... params)
Logs a new message.
|
void |
warning(java.lang.String msg)
Logs a new message with log level
Level.WARNING. |
void |
warning(java.lang.String msg,
java.lang.Throwable t)
Logs a new message with log level
Level.WARNING. |
void |
warning(java.util.function.Supplier<java.lang.String> msgSupplier)
Logs a new message with log level
Level.WARNING. |
public static final java.lang.String JVM_ARG_ENABLE_SLF4j_API
public static final boolean WRITE_TO_SLF4J_API
static final java.lang.String DEFAULT_SERVER_LOG_FILE_NAME
static final java.lang.String DEFAULT_CLIENT_LOG_FILE_NAME
static final java.util.logging.Level DEFAULT_ROOT_LEVEL
public static final int DEFAULT_FILE_LIMIT_BYTES
public static final int MIN_FILE_LIMIT_BYTES
public static final int DEFAULT_FILE_COUNT
public static final int MIN_FILE_COUNT
static final java.util.concurrent.atomic.AtomicBoolean IS_LOGGER_WORK_FINISHED
private static final java.lang.String ROOT_LOGGER_NAME
private static final java.util.Set<java.lang.ref.WeakReference<java.lang.Thread>> STREAM_LOGGING_THREADS
private static final java.util.Queue<ContextLogRecord> PRE_INIT_LOG_BUFFER
private static final java.util.Map<java.lang.String,java.util.logging.Level> LOGGER_LEVEL_MAP
private static final java.util.Map<java.util.logging.Level,org.slf4j.event.Level> JUL_TO_SLF4J_LEVEL_MAP
private static final java.lang.Object MODE_LOCK
private static volatile CentralLogger.Mode mode
private static final java.lang.ThreadLocal<java.lang.Boolean> mdcInitialized
private static volatile java.util.Map<java.lang.String,java.lang.String> mdcBaseContextMap
private static final java.util.Set<java.lang.ref.WeakReference<CentralLogger>> LOGGERS
private static BootstrapConfig bc
private final java.lang.String loggerName
private volatile java.util.logging.Level level
setLevel(Level).private final boolean checkParentLevels
private final boolean excludeSMContext
private volatile org.slf4j.Logger slf4jLogger
WRITE_TO_SLF4J_API.CentralLogger(java.lang.String loggerName,
java.util.logging.Level level,
boolean checkParentLevels,
boolean excludeSMContext)
loggerName - The name of the logger.level - The level of the logger.checkParentLevels - Flag to prevent recursion for class loaders.excludeSMContext - Flag to prevent deadlock on SecurityManager.public static void setMode(CentralLogger.Mode mode)
mode - The mode of the logger.public static boolean isClient()
true if running in client mode, false otherwise.public static void logStream(java.io.InputStream inputStream,
java.lang.String loggerName,
java.util.logging.Level loggerLevel,
java.util.logging.Level recordLevel,
java.util.concurrent.atomic.AtomicBoolean isProcessRunning)
A thread is created to parse the stream in background. A name for the assigned logger is provided in args, as well as a supplier to indicate when the work of the thread should stop. The thread is weakly referenced by a map (STREAM_LOGGING_THREADS) to be later woken up by a shutdown / termination app event. The thread is assigned a name formed by the logger name and "-Logger" postfix and starts execution. Its internal loop checks for new messages every one second.
The method usually receives either loggerLevel, or recordLevel arg to set the level of logging. On scanning each line of the stream is attempted to be parsed by the LogFormatter used by CentralLogger, which works for spawner JVM messages. If the message is not parsable and the record level is not provided in the args, there is an attempt to parse it from the msg, which works for spawn messages.
inputStream - The stream to be parsed to log messages.loggerName - The name of the logger to log the parsed messages.loggerLevel - The level of the logger. Overwrites the root / parents levels and ensures min allowed level
for log messages.recordLevel - The level of the log messages.isProcessRunning - Supplier of a flag to indicate when the stream should stop being parsed.public static CentralLogger get(java.lang.Class<?> clazz)
clazz - The class of the source of log messages.public static CentralLogger get(java.lang.String loggerName)
loggerName - The name of the logger.public static CentralLogger get(java.lang.String loggerName, boolean checkParentLevels, boolean excludeSMContext)
First it tries to restore the logger level, if it has already been set explicitly before, because logger levels are global for the app (a Java behavior of its LogManager, although not consistent due to GC intervention). CentralLogger has a consistent behavior of global levels.
Then it checks if the logger mode has already been determined. It's set once for all logger instances in the JVM. Setting the server / client mode should be the first statement in an app entry point. If it's not set, when the first logger instance is requested, there are two possibilities: a. The current Thread stacktrace indicates the logger is instantiated by a ClassLoader. Then a temporary mode is activated that creates wrapper instances for the actual logger determined later, i.e. CentralLoggerForClassLoaders; b. The app is running in conversion mode, as a standalone tool or a test and a default / fallback logger mode should be activated.
loggerName - The name of the logger.checkParentLevels - Flag to prevent recursion in class loaders, when determining the parent level.excludeSMContext - Flag to prevent deadlock on SecurityManager.public static void setLevels(CentralLoggerClientConfig loggerLevels)
loggerLevels - The new logger levels.static java.util.logging.Level getRootLevel()
static java.util.Map<java.lang.String,java.util.logging.Level> getLoggerLevelMap()
public static java.lang.String generate(java.lang.String spec,
java.lang.Object... params)
To be removed.
spec - The sprintf specification string.params - The substitution parameters.public static void handleShutDown()
The method sets the flag IS_PROCESS_RUNNING to false to make logger threads stop scanning for new messages and then interrupts all live logger threads. Then exits if all messages have already been processed as marked by the flag IS_LOGGER_WORK_FINISHED, which could be true in client mode.
Otherwise it gets the remaining log records from the pre-init buffer and the client log supplier (server loggers don't keep logs in buffers after initialization, but directly record them to files) and writes them to a file in the JVM launch dir, named after the logger mode, e.g. `server_crash_%datetime.log`, `client_crash_%datetime.log`.
public static void setBootstrapConfig(BootstrapConfig bc)
bc - The bootstrap config reader.public static void initializeClient(CentralLoggerClientConfig config)
ThinClient, received
when the server sends the logging configs.config - The logger levels as coming from server configs.static void completePreInitWork(java.util.Map<java.lang.String,java.util.logging.Level> nameLevelMap,
java.util.logging.Level rootLevel)
nameLevelMap - Logger name, level pairs.rootLevel - The root logger level.static CentralLogger.Mode getMode()
static void addToPreInitBuffer(ContextLogRecord lr)
lr - The log record.static java.util.logging.FileHandler setFileHandler(boolean isRotationDisabled,
java.lang.String filePath,
int rotationLimit,
int rotationCount,
java.util.logging.Formatter formatter)
throws java.io.IOException
isRotationDisabled - Flag to disable log file rotation.filePath - The log file path.rotationLimit - The file rotation limit.rotationCount - The file rotation count.formatter - The log formatter.java.io.IOException - Exception caused by file I/O operations.static java.util.logging.Level findLevel(java.lang.String loggerName,
boolean checkParentLevels)
checkParentLevels is
true, to avoid recursion the global level is returned. If the logger name can be parsed to a class
name, the level of the closest parent package is returned. If no parent packages have log levels set,
the root logger, i.e. "", level is returned.loggerName - The name of the logger.checkParentLevels - Flag to prevent recursion for class loaders.private static void publishPreInitBuffer()
private static void listenForShutDown()
private static void createCrashLogFile(CentralLogger.Mode loggerMode, java.util.List<ContextLogRecord> preInitLogBuffer, java.util.List<java.util.logging.LogRecord> leftoverLogs)
loggerMode - The logger mode.preInitLogBuffer - The list of logs held in the pre-init buffer.leftoverLogs - The list of logs held on the client with server-side logging.private static java.util.Optional<java.util.logging.Level> parseRecordLevel(java.lang.String msg)
msg - The log message.private static boolean hasParentClassLoader()
private static void invalidateLoggerTreeLevelCache(java.lang.String loggerName)
loggerName - The name of the logger with a new level.protected abstract void publish(ContextLogRecord logRecord)
logRecord - The log record.public boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - The object to compare to.true if it's the same instance or name and level are the same.
false otherwise.public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String getLoggerName()
public java.util.logging.Level getLevel()
public java.util.logging.Level getExplicitLevel()
public void setLevel(java.util.logging.Level level)
level - The level to set to the logger.public boolean isCheckParentLevels()
true if the log level can be determined by checking the parent loggers.public boolean isExcludeSMContext()
true if context should not be fetched from SecurityManager,
false otherwise.public boolean isLoggable(java.util.logging.Level logLevel)
logLevel - The level of the log msg.true if loggable, false otherwise.public void log(java.util.logging.Level level,
java.util.function.Supplier<java.lang.String> msgSupplier)
level - The level of the log msg.msgSupplier - Supplier for the log msg.public void log(java.util.logging.Level level,
java.lang.String msg)
level - The level of the log msg.msg - The log msg.public void log(java.util.logging.Level level,
java.lang.String msg,
java.lang.Throwable t)
level - The level of the log msg.msg - The log msg.t - Throwable.public void log(java.util.logging.Level level,
java.lang.String msgFormat,
java.lang.Object... params)
%s, because the client logger sends the parameters as part of
CentralLogRecord to the server and parsing Externalizables supports limited types.
This method overload can be easily misused by passing in a Throwable as the last argument and the Throwable will not be logged, so there is an argument verification.
level - The level of the log msg.msgFormat - The log msg format.params - The format params.public void log(java.util.logging.Level level,
java.lang.Throwable t,
java.lang.String msgFormat,
java.lang.Object... params)
%s, because the client logger sends the parameters as part of
CentralLogRecord to the server and parsing Externalizables supports limited types.level - The level of the log msg.t - Throwable.msgFormat - The log msg format.params - The format params.public void logp(java.util.logging.Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String msg)
level - The level of the log msg.sourceClass - The class where the msg originates from.sourceMethod - The method where the msg originates from.msg - The log msg.public void logp(java.util.logging.Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String msg,
java.lang.Throwable t)
level - The level of the log msg.sourceClass - The class where the msg originates from.sourceMethod - The method where the msg originates from.msg - The log msg.t - Throwable.public void severe(java.lang.String msg)
Level.SEVERE.msg - The log msg.public void severe(java.lang.String msg,
java.lang.Throwable t)
Level.SEVERE.msg - The log msg.t - Throwable.public void warning(java.lang.String msg)
Level.WARNING.msg - The log msg.public void warning(java.lang.String msg,
java.lang.Throwable t)
Level.WARNING.msg - The log msg.t - Throwable.public void warning(java.util.function.Supplier<java.lang.String> msgSupplier)
Level.WARNING. The message is evaluated after determined if
it can be logged. The supplier role is to delay costly evaluation.msgSupplier - The log msg.public void info(java.lang.String msg)
Level.INFO.msg - The log msg.public void info(java.lang.String msg,
java.lang.Throwable t)
Level.INFO.msg - The log msg.t - Throwable.public void config(java.lang.String msg)
Level.CONFIG.msg - The log msg.public void fine(java.lang.String msg)
Level.FINE.msg - The log msg.public void fine(java.util.function.Supplier<java.lang.String> msgSupplier)
Level.FINE. The message is evaluated after determined if
it can be logged. The supplier role is to delay costly evaluation.msgSupplier - The log msg.public void finer(java.lang.String msg)
Level.FINER.msg - The log msg.public void finest(java.lang.String msg)
Level.FINEST.msg - The log msg.public void all(java.lang.String msg)
Level.ALL.msg - The log msg.void logToSlf4j(ContextLogRecord logRecord, boolean isServer, boolean isServerSideLogging)
logRecord - The log record.isServer - true if in a server process.isServerSideLogging - true if server-side logging is enabled.static org.slf4j.spi.LoggingEventBuilder getSlf4jLogBuilder(org.slf4j.Logger slf4jLogger,
java.util.logging.LogRecord logRecord)
slf4jLogger - The slf4j logger that is to log the record.logRecord - The java log record to be used for the slf4j event.private boolean canLog(java.util.logging.Level level,
java.lang.String msg)
level - The log level.msg - The log msg.true if the msg can be logged, false otherwise.java.lang.IllegalArgumentException - If log level is null.private void log(ContextLogRecord logRecord)
logRecord - The log record.private void ultimateLog(java.util.logging.Level level,
java.lang.Throwable t,
java.lang.String sourceClass,
java.lang.String sourceMethod,
ContextLogRecord.LogContext context,
java.lang.String msg,
java.lang.Object... params)
%s, because the client logger sends the parameters as part of
CentralLogRecord to the server and parsing Externalizables supports limited types.level - The level of the log msg.sourceClass - The class where the msg originates from.sourceMethod - The method where the msg originates from.t - Throwable.context - The original context of the log record.msg - The log msg.params - The format params.