Class Log4jLoggingSystem
java.lang.Object
io.micronaut.management.endpoint.loggers.impl.Log4jLoggingSystem
- All Implemented Interfaces:
LoggingSystem
,ManagedLoggingSystem
@Singleton
@Requires(beans=LoggersEndpoint.class) @Requires(classes=org.apache.logging.log4j.core.LoggerContext.class)
@Replaces(Log4jLoggingSystem.class)
public class Log4jLoggingSystem
extends Object
implements ManagedLoggingSystem, LoggingSystem
An implementation of
ManagedLoggingSystem
that works with logback.- Since:
- 2.2.0
- Author:
- Matteo Vaccari, Matthew Moss
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns aLoggerConfiguration
for the logger found by name (or created if not found).Returns all existing loggers.void
setLogLevel
(String name, LogLevel level) Set the log level for the logger found by name (or created if not found).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.logging.LoggingSystem
refresh
-
Constructor Details
-
Log4jLoggingSystem
public Log4jLoggingSystem()
-
-
Method Details
-
getLoggers
Description copied from interface:ManagedLoggingSystem
Returns all existing loggers.- Specified by:
getLoggers
in interfaceManagedLoggingSystem
- Returns:
- A
Collection
ofLoggerConfiguration
instances for all existing loggers
-
getLogger
Description copied from interface:ManagedLoggingSystem
Returns aLoggerConfiguration
for the logger found by name (or created if not found).- Specified by:
getLogger
in interfaceManagedLoggingSystem
- Parameters:
name
- the logger name- Returns:
- the logger configuration
-
setLogLevel
Description copied from interface:LoggingSystem
Set the log level for the logger found by name (or created if not found).- Specified by:
setLogLevel
in interfaceLoggingSystem
- Parameters:
name
- the logger namelevel
- the log level to set on the named logger
-