Search in sources :

Example 1 with LogbackLoggingSystem

use of org.springframework.boot.logging.logback.LogbackLoggingSystem in project spring-boot by spring-projects.

the class EndpointMBeanExporterTests method registerLoggersEndpoint.

private MBeanExporter registerLoggersEndpoint() {
    this.context = new GenericApplicationContext();
    this.context.registerBeanDefinition("endpointMbeanExporter", new RootBeanDefinition(EndpointMBeanExporter.class));
    RootBeanDefinition bd = new RootBeanDefinition(LoggersEndpoint.class);
    ConstructorArgumentValues values = new ConstructorArgumentValues();
    values.addIndexedArgumentValue(0, new LogbackLoggingSystem(getClass().getClassLoader()));
    bd.setConstructorArgumentValues(values);
    this.context.registerBeanDefinition("loggersEndpoint", bd);
    this.context.refresh();
    return this.context.getBean(EndpointMBeanExporter.class);
}
Also used : GenericApplicationContext(org.springframework.context.support.GenericApplicationContext) RootBeanDefinition(org.springframework.beans.factory.support.RootBeanDefinition) LogbackLoggingSystem(org.springframework.boot.logging.logback.LogbackLoggingSystem) ConstructorArgumentValues(org.springframework.beans.factory.config.ConstructorArgumentValues)

Aggregations

ConstructorArgumentValues (org.springframework.beans.factory.config.ConstructorArgumentValues)1 RootBeanDefinition (org.springframework.beans.factory.support.RootBeanDefinition)1 LogbackLoggingSystem (org.springframework.boot.logging.logback.LogbackLoggingSystem)1 GenericApplicationContext (org.springframework.context.support.GenericApplicationContext)1