Failed to instantiate [ch.qos.logback.classic.LoggerContext]
See original GitHub issueHi Tony,
I’ve used logback in the past with great love. 😃 Decided to update to latest versions of SLF4J and logback as I am starting another android project.
- logback-android-1.1.1-2.jar
- slf4j-api-1.7.6.jar
Searched for answer in this issues list and internet but not found solution yet. Is there another library required? ~~
logback.xml is a bare bones logcat appender case.
<configuration debug="true" >
<!-- LogCat Appender -->
<appender
name="LOGCAT_OUT"
class="ch.qos.logback.classic.android.LogcatAppender" >
<!-- Format the message content -->
<encoder>
<!-- Simple output -->
<pattern>%msg%n</pattern>
</encoder>
</appender>
<root level="INFO" >
<appender-ref ref="LOGCAT_OUT" />
</root>
</configuration>
However, running the application gives the following error after parsing the root’s appender-ref.
04-01 18:32:45.971: I/System.out(18058): 18:32:45,986 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@36:42 - no applicable action for [appender-ref], current ElementPath is [[root][appender-ref]]
04-01 18:32:45.981: W/System.err(18058): **Failed to instantiate** [ch.qos.logback.classic.LoggerContext]
04-01 18:32:45.981: W/System.err(18058): Reported exception:
04-01 18:32:45.981: W/System.err(18058): java.util.EmptyStackException
~~ Any help appreciated - Thanks!
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Spring Boot/Gradle/Logback: bootRun fails with "Failed to ...
Spring Boot/Gradle/Logback: bootRun fails with "Failed to instantiate [ch.qos.logback.classic.LoggerContext]": java.lang.AbstractMethodError:.
Read more >How to fix ch.qos.logback.classic. LoggerContext [default]
How to fix ch.qos.logback.classic. LoggerContext [default] – Could NOT find resource [logback-test.xml] Info message? (Java).
Read more >bootRun fails with "Failed to instantiate [ch.qos.logback.classic ...
Coding example for the question Spring Boot/Gradle/Logback: bootRun fails with "Failed to instantiate [ch.qos.logback.classic.LoggerContext]": java.lang.
Read more >Failed to instantiate [ch.qos.logback.classic.LoggerContext ...
Failed to instantiate [ch.qos.logback.classic.LoggerContext] Reported exception: java.lang.NullPointerException.
Read more >412012 – Failed to instantiate [ch.qos.logback.classic ... - Bugs
Using PATH instead. Failed to instantiate [ch.qos.logback.classic.LoggerContext] Reported exception: java.lang.reflect.InvocationTargetException ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Followup note: (possible bug?)
If a config.xml uses ‘includes’ to load settings from another child config then apparently the child cannot have ‘configuration’ tags.
[Note: This seems odd since we could use ‘includes’ to replicate the legacy logback-test.xml versus logback.xml loading approach where, presumably, those xml’s would have ‘configuration’ tagged blocks.]
Example: logback.xml
The child [apparently] needs to omit the ‘configuration’ tag else the closing tag in the child xml will also close the parsing in the parent such that anything after the ‘includes’ will fail. If debug=“true” then will see “no applicable action” messages for otherwise valid logcat entries.
assets/logback-child.xml
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.