// package & imports
class TylerConfigurator extends TylerConfiguratorBase implements Configurator {
@Override
public Configurator.ExecutionStatus configure(LoggerContext loggerContext) {
setContext(loggerContext);
if(${consoleEnabled}) { // <---------------------------- this does not compile
Logger logger_ROOT = setupLogger("ROOT", "info", null);
Appender appenderCONSOLE = setupAppenderCONSOLE();
}
return ExecutionStatus.DO_NOT_INVOKE_NEXT_IF_ANY;
}
Appender setupAppenderCONSOLE() {
ConsoleAppender appenderCONSOLE = new ConsoleAppender();
appenderCONSOLE.setContext(context);
appenderCONSOLE.setName("CONSOLE");
// Configure component of type PatternLayoutEncoder
PatternLayoutEncoder patternLayoutEncoder = new PatternLayoutEncoder();
patternLayoutEncoder.setContext(context);
patternLayoutEncoder.setPattern("%d{YYYY-MM-dd HH:mm:ss.SSS} %5level %logger{0} [%t] - %msg%n");
patternLayoutEncoder.setParent(appenderCONSOLE);
patternLayoutEncoder.start();
// Inject component of type PatternLayoutEncoder into parent
appenderCONSOLE.setEncoder(patternLayoutEncoder);
appenderCONSOLE.start();
return appenderCONSOLE;
}
}
As you can see, the if condition that uses a spring expression is not converted correctly - probably because logback-tyler doesn't know anything about spring.
Is there anything that spring-boot could do to participate in the conversion for spring specific features?
Take the following configuration:
The logback-tyler output would be:
As you can see, the if condition that uses a spring expression is not converted correctly - probably because logback-tyler doesn't know anything about spring.
Is there anything that spring-boot could do to participate in the conversion for spring specific features?
Versions: