@Singleton public class JulLoggingService extends AbstractSreService implements LoggingService
The LoggingService considers the parameters of the functions as:
If a Throwable
is passed as parameter, the text of the exception is retrieved.
If a Callable
is passed as parameter, the object is automatically called.
If a LogParam
is passed as parameter, the toString
function will be invoked.
For all the other objects, the AbstractService.toString()
function is invoked.
This service is thread-safe.
Constructor and Description |
---|
JulLoggingService(loggerCreator : JulLoggerCreator)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Logger |
createAgentLogger(name : String,
[initialLevel : Level])
Create a logger for an agent.
|
Logger |
getKernelLogger()
Replies the logger used by the kernel.
|
Logger |
getKernelModuleLogger(moduleName : String)
Replies the logger used by a specific module of the kernel.
|
Logger |
getPlatformLogger()
Replies the logger used by the platform.
|
doStart, doStop, onStart, onStop
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, doCancelStart, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync, toString
@Inject
public new
(loggerCreator : JulLoggerCreator)
loggerCreator
- the creator.@Pure
public def
getPlatformLogger() : Logger
LoggingService
getPlatformLogger
in interface LoggingService
@Pure
public def
getKernelLogger() : Logger
LoggingService
getKernelLogger
in interface LoggingService
LoggingService.getKernelModuleLogger(String)
@Pure
public def
getKernelModuleLogger(moduleName : String) : Logger
LoggingService
getKernelModuleLogger
in interface LoggingService
LoggingService.getKernelLogger()
public def
createAgentLogger(name : String,
[initialLevel : Level]) : Logger
LoggingService
createAgentLogger
in interface LoggingService
name
- the name of the logger, usually the name of the agent.initialLevel
- the initial level to associate to the logger. If it is
null
, the level is the less verbose between the default level
(given in the SRE configuration) and the parent level.Copyright © 2021 the original authors or authors.