Class LogbackLoggingSystem
java.lang.Object
io.micronaut.management.endpoint.loggers.impl.LogbackLoggingSystem
- All Implemented Interfaces:
io.micronaut.logging.LoggingSystem,ManagedLoggingSystem
@Singleton
@Requires(beans=LoggersEndpoint.class) @Requires(classes=ch.qos.logback.classic.LoggerContext.class)
@Replaces(io.micronaut.logging.impl.LogbackLoggingSystem.class)
public class LogbackLoggingSystem
extends Object
implements ManagedLoggingSystem, io.micronaut.logging.LoggingSystem
An implementation of
ManagedLoggingSystem that works with logback.- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NonNull LoggerConfigurationReturns aLoggerConfigurationfor the logger found by name (or created if not found).@NonNull Collection<LoggerConfiguration>Returns all existing loggers.voidrefresh()voidsetLogLevel(String name, io.micronaut.logging.LogLevel level)
-
Constructor Details
-
LogbackLoggingSystem
public LogbackLoggingSystem(@Nullable @Property(name="logger.config") @Nullable String logbackXmlLocation)
-
-
Method Details
-
getLoggers
Description copied from interface:ManagedLoggingSystemReturns all existing loggers.- Specified by:
getLoggersin interfaceManagedLoggingSystem- Returns:
- A
CollectionofLoggerConfigurationinstances for all existing loggers
-
getLogger
Description copied from interface:ManagedLoggingSystemReturns aLoggerConfigurationfor the logger found by name (or created if not found).- Specified by:
getLoggerin interfaceManagedLoggingSystem- Parameters:
name- the logger name- Returns:
- the logger configuration
-
setLogLevel
- Specified by:
setLogLevelin interfaceio.micronaut.logging.LoggingSystem
-
refresh
public void refresh()- Specified by:
refreshin interfaceio.micronaut.logging.LoggingSystem
-