You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just need appender CONSOLE_JSON (which is defined later on in that file) but since both of them are there, I get an error when I try to run the application on Windows. In fact, I'm not exactly sure whether STDOUT needs to be defined there at all.
So if there's no actual need I think that appender should be removed from the configuration file. In case it has to be there for some reason, I'd expect this withJansi flag to be configurable (something like <withJansi>${stdout.withJansi:true}</withJansi> would be enough).
Actual Behaviour
Stacktrace:
-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
-INFO in ch.qos.logback.core.ConsoleAppender[STDOUT] - Enabling JANSI WindowsAnsiOutputStream for the console.
-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - Failed to create WindowsAnsiOutputStream. Falling back on the default stream. ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream
at ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:69)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:40)
at at ch.qos.logback.core.ConsoleAppender.getTargetStreamForWindows(ConsoleAppender.java:88)
at at ch.qos.logback.core.ConsoleAppender.start(ConsoleAppender.java:79)
at at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:90)
at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:309)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:193)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:179)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
at at io.micronaut.runtime.Micronaut.<clinit>(Micronaut.java:49)
at at foobar.Application.main(Application.java:8)
Caused by: java.lang.ClassNotFoundException: org.fusesource.jansi.WindowsAnsiOutputStream
at at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:56)
at ... 23 common frames omitted
17:13:48,151 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
17:13:48,151 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE_JSON]
17:13:48,255 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
17:13:48,255 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CONSOLE_JSON] to Logger[ROOT]
17:13:48,256 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
I'm following Micronaut GCP guide and bumped into this problem:
Steps to Reproduce
mn create-app foobar
implementation("io.micronaut.gcp:micronaut-gcp-logging")
src/main/resources/logback.xml
with:./gradlew run
on WindowsExpected Behaviour
I was expecting that
withJansi
was not enabled by default, at least on Windows.I looked into included file
io/micronaut/gcp/logging/logback-json-appender.xml
and discovered that an appenderSTDOUT
is being defined inside it:I just need appender
CONSOLE_JSON
(which is defined later on in that file) but since both of them are there, I get an error when I try to run the application on Windows. In fact, I'm not exactly sure whetherSTDOUT
needs to be defined there at all.So if there's no actual need I think that appender should be removed from the configuration file. In case it has to be there for some reason, I'd expect this
withJansi
flag to be configurable (something like<withJansi>${stdout.withJansi:true}</withJansi>
would be enough).Actual Behaviour
Stacktrace:
Environment Information
Example Application
The text was updated successfully, but these errors were encountered: