Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to instantiate [ch.qos.logback.classic.LoggerContext] #66

Closed
DevByStarlight opened this issue Apr 2, 2014 · 7 comments
Closed

Comments

@DevByStarlight
Copy link

Hi 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!

@DevByStarlight
Copy link
Author

Resolved.
Found an error in the config file which was causing the parser to terminate early.

@DevByStarlight
Copy link
Author

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

<configuration>
    <includes>
    <include resource="assets/logback-child.xml" />
    </includes>

    <!-- LogCat Appender -->
    <appender name="logcat_dflt" class="ch.qos.logback.classic.android.LogcatAppender" >
        <encoder>
            <pattern>%msg</pattern>
        </encoder>
    </appender>

    <root level="TRACE" >
        <appender-ref ref="logcat_dflt" />
    </root>

</configuration>

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

    <!-- Note missing 'configuration' tag. When I have them the logback parsing fails -->

    <!-- Define an output path -->
    <property name="LOG_DIR" value="/sdcard/com.example.package/logs" />

    <!-- Create an appender for trace messages -->
    <appender
        name="TraceLog"
        class="ch.qos.logback.core.FileAppender" >

        <filter class="ch.qos.logback.classic.filter.LevelFilter" >
            <level>TRACE</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>

        <file>${LOG_DIR}/trace.log</file>

        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>


    <logger name="com.example" level="WARN" />
    <logger name="com.example.pacakge.Some" level="INHERITED" />
    <logger name="com.example.pacakge.Other" level="TRACE" >
        <appender-ref ref="TraceLog" />
    </logger>
    <logger name="com.example.pacakge.Thing" level="INHERITED" />

@tony19
Copy link
Owner

tony19 commented Apr 3, 2014

I can't reproduce the problem with loading the child config. I might be missing a step. Can you create a new issue for this problem? Please add some details to reproduce the problem. Thanks.

Note that when using <include>, the included file contents can be contained in either a <configuration> tag or <included> tag.

@DevByStarlight
Copy link
Author

[Hopefully re-opening this issue is okay? I could create another. But same topic and history of previous comments kept together. Plus, my 'resolution' above wasn't really a proper solve for my original problem anyway.]

  • Created a brand new android project using the logback and slf4j libraries on this github page.
  • NOTE: Since desire to write log files to sdcard, need to ask for permissions in the manifest
    ** uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"

Unable to attach files so pasted content in this post below.
Summarized here:

  1. logback.xml - The 'parent' configuration file logback finds on startup
  2. logback-works.xml - ('child') Working version of an imported child with no 'configuration' or 'included' tags
  3. logback-fails_Con.xml - ('child') Identical to 'works' version but uses an outer 'configuration' block tag
  4. logback-fails_Inc.xml - ('child') Identical to 'works' version but uses an outer 'included' block tag
  • At the bottom is the logcat output from running the demo app three times in succession changing which child is imported via the include statement in logback.xml (parent).
    ** First run: 'logback.xml' points to 'works' child config
    ** Second run: 'logback.xml' points to 'fails_Con' child config
    ** Third run: 'logback points to 'fails_Inc' child config
    (See the "LOOK_AT_ME" comment in the logback.xml)
  • NOTE: The config xml below is copied verbatim in their entirety

I can zip up the entire android project and mail to you as well if that would help.
Running on a Nexus 7 device (and others)

~~

logback.xml

<configuration debug="true">

    <!--  Search for: "LOOK_AT_ME" for specific items of interest -->


    <!--  ~*~*~*~*~ -->
    <!--  ~*~*~*~*~ -->

    <!--
    Import additional settings file if available.
    (If absent, logging system will handle it gracefully.)
    -->

    <!-- LOOK_AT_ME:
    - Comment in/out one of these includes blocks.
    - The "works" version omits the <configuration> and <included> block tags.
    - The "fails_Con" uses the <configuration> tag
    - The "fails_Con" uses the <included> tag

    - Both of the fails cases seem to terminate the parser in the parent config
      .. ie, after finishes parsing the child, the appender and root logger definitions in parent fail loading
    -->

    <includes>
    <include resource="assets/logback-works.xml" />
    </includes>

    <!--
    <includes>
    <include resource="assets/logback-fails_Con.xml" />
    </includes>
    -->

    <!--
    <includes>
    <include resource="assets/logback-fails_Inc.xml" />
    </includes>
    -->

    <!--  ~*~*~*~*~ -->
    <!--  ~*~*~*~*~ -->

    <!-- LogCat Appender -->
    <appender
        name="logcat_dflt"
        class="ch.qos.logback.classic.android.LogcatAppender" >

        <!-- (optional) Abbreviate the tag string -->
        <!--
        <tagEncoder>
            <pattern>%logger{3}</pattern>
        </tagEncoder>
        -->

        <!-- Format the message content -->
        <encoder>
            <!-- Default log message format -->
            <!-- <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}%n %msg%n</pattern> -->

            <!-- Simple output -->
            <pattern>|%.-1level|[%thread][%method]\t%msg%n</pattern>
        </encoder>
    </appender>


    <root level="WARN" >
        <appender-ref ref="logcat_dflt" />
    </root>

</configuration>

~~

logback-works.xml


  <!-- ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* -->
  <!-- ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* -->


    <!-- Declare a path for writing log files. -->
    <property
        name="LOG_DIR"
        value="/sdcard/dev.demo.DemoWeirdLog/logs" />

    <!--
    LogCat Appender
    NOTE: Our parent logback config defines a default appender in case we are not imported (eg, release builds).
    We define another here for our use.
    -->
    <appender
        name="logcat"
        class="ch.qos.logback.classic.android.LogcatAppender" >

        <!-- (optional) Abbreviate the tag string -->
        <!--
        <tagEncoder>
            <pattern>%logger{3}</pattern>
        </tagEncoder>
        -->

        <!-- Format the message content -->
        <encoder>
            <!-- Generic log message format -->
            <!-- <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}%n %msg%n</pattern> -->

            <!-- Simple output -->
            <pattern>|%.-1level|[%thread][%method]\t%msg%n</pattern>
        </encoder>
    </appender>


    <!--
    Define a file appender for TRACE-level messages.
    Logcat buffers only so many before they scroll off.
    So this allows developer to pull the full log and examine at leisure.

    Add this as an "<appender-ref ref="TraceLog" />" for whichever logger
    should redirect to the trace file (in addition to logcat).
    -->
    <appender
        name="TraceLog"
        class="ch.qos.logback.core.FileAppender" >

        <filter class="ch.qos.logback.classic.filter.LevelFilter" >
            <level>TRACE</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>

        <file>${LOG_DIR}/demo_trace.log</file>

        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>


    <!-- ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* -->
    <!-- ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* -->

    <!-- ~*~*~*~*~ Add explicitly defined modules below ~*~*~*~*~ -->

    <!-- ... logical grouping is helpful to others ... -->
    <!-- Grouping is by package from general to more specific -->

    <!-- Top Level -->
    <logger name="dev.demo" level="TRACE" />

    <logger name="dev.demo.DemoWeirdLog" level="INHERITED" />

    <logger name="dev.demo.DemoWeirdLog.MainActivity" level="INHERITED" />


~~

logback-fails_Con.xml

<configuration>

  <!-- ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* -->
  <!-- ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* -->


    <!-- Declare a path for writing log files. -->
    <property
        name="LOG_DIR"
        value="/sdcard/dev.demo.DemoWeirdLog/logs" />

    <!--
    LogCat Appender
    NOTE: Our parent logback config defines a default appender in case we are not imported (eg, release builds).
    We define another here for our use.
    -->
    <appender
        name="logcat"
        class="ch.qos.logback.classic.android.LogcatAppender" >

        <!-- (optional) Abbreviate the tag string -->
        <!--
        <tagEncoder>
            <pattern>%logger{3}</pattern>
        </tagEncoder>
        -->

        <!-- Format the message content -->
        <encoder>
            <!-- Generic log message format -->
            <!-- <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}%n %msg%n</pattern> -->

            <!-- Simple output -->
            <pattern>|%.-1level|[%thread][%method]\t%msg%n</pattern>
        </encoder>
    </appender>


    <!--
    Define a file appender for TRACE-level messages.
    Logcat buffers only so many before they scroll off.
    So this allows developer to pull the full log and examine at leisure.

    Add this as an "<appender-ref ref="TraceLog" />" for whichever logger
    should redirect to the trace file (in addition to logcat).
    -->
    <appender
        name="TraceLog"
        class="ch.qos.logback.core.FileAppender" >

        <filter class="ch.qos.logback.classic.filter.LevelFilter" >
            <level>TRACE</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>

        <file>${LOG_DIR}/demo_trace.log</file>

        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>


    <!-- ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* -->
    <!-- ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* -->

    <!-- ~*~*~*~*~ Add explicitly defined modules below ~*~*~*~*~ -->

    <!-- ... logical grouping is helpful to others ... -->
    <!-- Grouping is by package from general to more specific -->

    <!-- Top Level -->
    <logger name="dev.demo" level="TRACE" />

    <logger name="dev.demo.DemoWeirdLog" level="INHERITED" />

    <logger name="dev.demo.DemoWeirdLog.MainActivity" level="INHERITED" />

</configuration>

~~

logback-fails_Inc.xml

<included>

  <!-- ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* -->
  <!-- ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* -->


    <!-- Declare a path for writing log files. -->
    <property
        name="LOG_DIR"
        value="/sdcard/dev.demo.DemoWeirdLog/logs" />

    <!--
    LogCat Appender
    NOTE: Our parent logback config defines a default appender in case we are not imported (eg, release builds).
    We define another here for our use.
    -->
    <appender
        name="logcat"
        class="ch.qos.logback.classic.android.LogcatAppender" >

        <!-- (optional) Abbreviate the tag string -->
        <!--
        <tagEncoder>
            <pattern>%logger{3}</pattern>
        </tagEncoder>
        -->

        <!-- Format the message content -->
        <encoder>
            <!-- Generic log message format -->
            <!-- <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}%n %msg%n</pattern> -->

            <!-- Simple output -->
            <pattern>|%.-1level|[%thread][%method]\t%msg%n</pattern>
        </encoder>
    </appender>


    <!--
    Define a file appender for TRACE-level messages.
    Logcat buffers only so many before they scroll off.
    So this allows developer to pull the full log and examine at leisure.

    Add this as an "<appender-ref ref="TraceLog" />" for whichever logger
    should redirect to the trace file (in addition to logcat).
    -->
    <appender
        name="TraceLog"
        class="ch.qos.logback.core.FileAppender" >

        <filter class="ch.qos.logback.classic.filter.LevelFilter" >
            <level>TRACE</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>

        <file>${LOG_DIR}/demo_trace.log</file>

        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>


    <!-- ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* -->
    <!-- ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* -->

    <!-- ~*~*~*~*~ Add explicitly defined modules below ~*~*~*~*~ -->

    <!-- ... logical grouping is helpful to others ... -->
    <!-- Grouping is by package from general to more specific -->

    <!-- Top Level -->
    <logger name="dev.demo" level="TRACE" />

    <logger name="dev.demo.DemoWeirdLog" level="INHERITED" />

    <logger name="dev.demo.DemoWeirdLog.MainActivity" level="INHERITED" />

</included>

~~

Logcat output from running app three times in a row

04-03 10:57:50.105: I/System.out(28160): Sending WAIT chunk
04-03 10:57:50.105: W/ActivityThread(28160): Application dev.demo.DemoWeirdLog is waiting for the debugger on port 8100...
04-03 10:57:50.105: I/dalvikvm(28160): Debugger is active
04-03 10:57:50.305: I/System.out(28160): Debugger has connected
04-03 10:57:50.305: I/System.out(28160): waiting for debugger to settle...
04-03 10:57:50.505: I/System.out(28160): waiting for debugger to settle...
04-03 10:57:50.705: I/System.out(28160): waiting for debugger to settle...
04-03 10:57:50.905: I/System.out(28160): waiting for debugger to settle...
04-03 10:57:51.105: I/System.out(28160): waiting for debugger to settle...
04-03 10:57:51.305: I/System.out(28160): waiting for debugger to settle...
04-03 10:57:51.505: I/System.out(28160): waiting for debugger to settle...
04-03 10:57:51.705: I/System.out(28160): debugger has settled (1370)
04-03 10:57:51.925: I/System.out(28160): 10:57:51,839 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [assets/logback.xml] at [assets/logback.xml]
04-03 10:57:51.935: I/System.out(28160): 10:57:51,950 |-INFO in ch.qos.logback.classic.joran.action.FindIncludeAction - Path found [jar:file:/data/app/dev.demo.DemoWeirdLog-1.apk!/assets/logback-works.xml]
04-03 10:57:51.945: I/System.out(28160): 10:57:51,955 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil@417aa020 - Adding [jar:file:/data/app/dev.demo.DemoWeirdLog-1.apk!/assets/logback-works.xml] to configuration watch list.
04-03 10:57:51.945: I/System.out(28160): 10:57:51,958 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@417aa450 - URL [jar:file:/data/app/dev.demo.DemoWeirdLog-1.apk!/assets/logback-works.xml] is not of type file
04-03 10:57:51.975: D/dalvikvm(28160): GC_CONCURRENT freed 275K, 9% free 7421K/8071K, paused 12ms+1ms, total 27ms
04-03 10:57:52.075: I/System.out(28160): 10:57:52,082 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.android.LogcatAppender]
04-03 10:57:52.075: I/System.out(28160): 10:57:52,085 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [logcat]
04-03 10:57:52.115: I/System.out(28160): 10:57:52,130 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
04-03 10:57:52.255: I/System.out(28160): 10:57:52,261 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
04-03 10:57:52.255: I/System.out(28160): 10:57:52,264 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [TraceLog]
04-03 10:57:52.415: D/dalvikvm(28160): GC_CONCURRENT freed 390K, 10% free 7466K/8263K, paused 1ms+2ms, total 14ms
04-03 10:57:52.605: I/System.out(28160): 10:57:52,610 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
04-03 10:57:52.785: I/System.out(28160): 10:57:52,799 |-INFO in ch.qos.logback.core.FileAppender[TraceLog] - File property is set to [/sdcard/dev.demo.DemoWeirdLog/logs/demo_trace.log]
04-03 10:57:52.795: I/System.out(28160): 10:57:52,808 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [dev.demo] to TRACE
04-03 10:57:52.805: I/System.out(28160): 10:57:52,813 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [dev.demo.DemoWeirdLog] to null, i.e. INHERITED
04-03 10:57:52.805: I/System.out(28160): 10:57:52,818 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [dev.demo.DemoWeirdLog.MainActivity] to null, i.e. INHERITED
04-03 10:57:52.815: I/System.out(28160): 10:57:52,821 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.android.LogcatAppender]
04-03 10:57:52.815: I/System.out(28160): 10:57:52,824 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [logcat_dflt]
04-03 10:57:52.855: I/System.out(28160): 10:57:52,865 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
04-03 10:57:52.885: D/dalvikvm(28160): GC_CONCURRENT freed 419K, 10% free 7498K/8327K, paused 1ms+11ms, total 26ms
04-03 10:57:52.995: I/System.out(28160): 10:57:53,003 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to WARN
04-03 10:57:52.995: I/System.out(28160): 10:57:53,008 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [logcat_dflt] to Logger[ROOT]
04-03 10:57:53.005: I/System.out(28160): 10:57:53,011 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
04-03 10:57:53.005: I/System.out(28160): 10:57:53,015 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@4178c908 - Registering current configuration as safe fallback point
04-03 10:57:53.015: V/dev.demo.DemoWeirdLog.MainActivity(28160): |T|[main][TestLogger]  Hello- Trace
04-03 10:57:53.015: D/dev.demo.DemoWeirdLog.MainActivity(28160): |D|[main][TestLogger]  Hello- Debug
04-03 10:57:53.015: I/dev.demo.DemoWeirdLog.MainActivity(28160): |I|[main][TestLogger]  Hello- Info
04-03 10:57:53.015: W/dev.demo.DemoWeirdLog.MainActivity(28160): |W|[main][TestLogger]  Hello- Warn
04-03 10:57:53.015: E/dev.demo.DemoWeirdLog.MainActivity(28160): |E|[main][TestLogger]  Hello- Error
04-03 10:57:53.125: D/libEGL(28160): loaded /system/lib/egl/libEGL_tegra.so
04-03 10:57:53.135: D/libEGL(28160): loaded /system/lib/egl/libGLESv1_CM_tegra.so
04-03 10:57:53.145: D/libEGL(28160): loaded /system/lib/egl/libGLESv2_tegra.so
04-03 10:57:53.165: D/OpenGLRenderer(28160): Enabling debug mode 0
04-03 10:58:24.255: I/dalvikvm(28250): Debugger is active
04-03 10:58:24.445: I/System.out(28250): Debugger has connected
04-03 10:58:24.445: I/System.out(28250): waiting for debugger to settle...
04-03 10:58:24.645: I/System.out(28250): waiting for debugger to settle...
04-03 10:58:24.845: I/System.out(28250): waiting for debugger to settle...
04-03 10:58:25.045: I/System.out(28250): waiting for debugger to settle...
04-03 10:58:25.245: I/System.out(28250): waiting for debugger to settle...
04-03 10:58:25.445: I/System.out(28250): waiting for debugger to settle...
04-03 10:58:25.645: I/System.out(28250): waiting for debugger to settle...
04-03 10:58:25.845: I/System.out(28250): debugger has settled (1369)
04-03 10:58:26.065: I/System.out(28250): 10:58:25,975 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [assets/logback.xml] at [assets/logback.xml]
04-03 10:58:26.075: I/System.out(28250): 10:58:26,084 |-INFO in ch.qos.logback.classic.joran.action.FindIncludeAction - Path found [jar:file:/data/app/dev.demo.DemoWeirdLog-2.apk!/assets/logback-fails_Con.xml]
04-03 10:58:26.085: I/System.out(28250): 10:58:26,091 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil@417aaf78 - Adding [jar:file:/data/app/dev.demo.DemoWeirdLog-2.apk!/assets/logback-fails_Con.xml] to configuration watch list.
04-03 10:58:26.085: I/System.out(28250): 10:58:26,093 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@417ab3a8 - URL [jar:file:/data/app/dev.demo.DemoWeirdLog-2.apk!/assets/logback-fails_Con.xml] is not of type file
04-03 10:58:26.135: D/dalvikvm(28250): GC_CONCURRENT freed 279K, 9% free 7421K/8071K, paused 12ms+12ms, total 47ms
04-03 10:58:26.235: I/System.out(28250): 10:58:26,245 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.android.LogcatAppender]
04-03 10:58:26.235: I/System.out(28250): 10:58:26,249 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [logcat]
04-03 10:58:26.285: I/System.out(28250): 10:58:26,294 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
04-03 10:58:26.415: I/System.out(28250): 10:58:26,427 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
04-03 10:58:26.415: I/System.out(28250): 10:58:26,430 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [TraceLog]
04-03 10:58:26.595: D/dalvikvm(28250): GC_CONCURRENT freed 379K, 10% free 7469K/8263K, paused 11ms+12ms, total 34ms
04-03 10:58:26.795: I/System.out(28250): 10:58:26,806 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
04-03 10:58:26.985: I/System.out(28250): 10:58:26,995 |-INFO in ch.qos.logback.core.FileAppender[TraceLog] - File property is set to [/sdcard/dev.demo.DemoWeirdLog/logs/demo_trace.log]
04-03 10:58:26.995: I/System.out(28250): 10:58:27,002 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [dev.demo] to TRACE
04-03 10:58:26.995: I/System.out(28250): 10:58:27,006 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [dev.demo.DemoWeirdLog] to null, i.e. INHERITED
04-03 10:58:27.005: I/System.out(28250): 10:58:27,011 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [dev.demo.DemoWeirdLog.MainActivity] to null, i.e. INHERITED
04-03 10:58:27.005: I/System.out(28250): 10:58:27,014 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
04-03 10:58:27.015: I/System.out(28250): 10:58:27,021 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@46:64 - no applicable action for [appender], current ElementPath  is [[appender]]
04-03 10:58:27.015: I/System.out(28250): 10:58:27,028 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@56:18 - no applicable action for [encoder], current ElementPath  is [[appender][encoder]]
04-03 10:58:27.025: I/System.out(28250): 10:58:27,036 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@61:22 - no applicable action for [pattern], current ElementPath  is [[appender][encoder][pattern]]
04-03 10:58:27.035: I/System.out(28250): 10:58:27,043 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@66:25 - no applicable action for [root], current ElementPath  is [[root]]
04-03 10:58:27.045: I/System.out(28250): 10:58:27,050 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@67:43 - no applicable action for [appender-ref], current ElementPath  is [[root][appender-ref]]
04-03 10:58:27.045: W/System.err(28250): Failed to instantiate [ch.qos.logback.classic.LoggerContext]
04-03 10:58:27.045: W/System.err(28250): Reported exception:
04-03 10:58:27.045: W/System.err(28250): java.util.EmptyStackException
04-03 10:58:27.045: W/System.err(28250):    at java.util.Stack.pop(Stack.java:73)
04-03 10:58:27.045: W/System.err(28250):    at ch.qos.logback.core.joran.spi.Interpreter.endElement(Unknown Source)
04-03 10:58:27.045: W/System.err(28250):    at ch.qos.logback.core.joran.spi.Interpreter.endElement(Unknown Source)
04-03 10:58:27.045: W/System.err(28250):    at ch.qos.logback.core.joran.spi.EventPlayer.play(Unknown Source)
04-03 10:58:27.055: W/System.err(28250):    at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Unknown Source)
04-03 10:58:27.055: W/System.err(28250):    at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Unknown Source)
04-03 10:58:27.055: W/System.err(28250):    at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Unknown Source)
04-03 10:58:27.055: W/System.err(28250):    at ch.qos.logback.classic.util.ContextInitializer.autoConfig(Unknown Source)
04-03 10:58:27.055: W/System.err(28250):    at org.slf4j.impl.StaticLoggerBinder.init(Unknown Source)
04-03 10:58:27.055: W/System.err(28250):    at org.slf4j.impl.StaticLoggerBinder.<clinit>(Unknown Source)
04-03 10:58:27.055: W/System.err(28250):    at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
04-03 10:58:27.065: W/System.err(28250):    at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
04-03 10:58:27.065: W/System.err(28250):    at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)
04-03 10:58:27.065: W/System.err(28250):    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
04-03 10:58:27.065: W/System.err(28250):    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
04-03 10:58:27.065: W/System.err(28250):    at dev.demo.DemoWeirdLog.MainActivity.<init>(MainActivity.java:17)
04-03 10:58:27.065: W/System.err(28250):    at java.lang.Class.newInstanceImpl(Native Method)
04-03 10:58:27.065: W/System.err(28250):    at java.lang.Class.newInstance(Class.java:1319)
04-03 10:58:27.065: W/System.err(28250):    at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
04-03 10:58:27.065: W/System.err(28250):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
04-03 10:58:27.065: W/System.err(28250):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
04-03 10:58:27.065: W/System.err(28250):    at android.app.ActivityThread.access$600(ActivityThread.java:130)
04-03 10:58:27.065: W/System.err(28250):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
04-03 10:58:27.065: W/System.err(28250):    at android.os.Handler.dispatchMessage(Handler.java:99)
04-03 10:58:27.065: W/System.err(28250):    at android.os.Looper.loop(Looper.java:137)
04-03 10:58:27.065: W/System.err(28250):    at android.app.ActivityThread.main(ActivityThread.java:4745)
04-03 10:58:27.075: D/dalvikvm(28250): GC_CONCURRENT freed 429K, 11% free 7490K/8327K, paused 12ms+2ms, total 30ms
04-03 10:58:27.075: W/System.err(28250):    at java.lang.reflect.Method.invokeNative(Native Method)
04-03 10:58:27.075: W/System.err(28250):    at java.lang.reflect.Method.invoke(Method.java:511)
04-03 10:58:27.075: W/System.err(28250):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
04-03 10:58:27.075: W/System.err(28250):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
04-03 10:58:27.075: W/System.err(28250):    at dalvik.system.NativeStart.main(Native Method)
04-03 10:58:27.085: I/System.out(28250): 10:58:27,094 |-WARN in Logger[dev.demo.DemoWeirdLog.MainActivity] - No appenders present in context [default] for logger [dev.demo.DemoWeirdLog.MainActivity].
04-03 10:58:27.195: D/libEGL(28250): loaded /system/lib/egl/libEGL_tegra.so
04-03 10:58:27.215: D/libEGL(28250): loaded /system/lib/egl/libGLESv1_CM_tegra.so
04-03 10:58:27.225: D/libEGL(28250): loaded /system/lib/egl/libGLESv2_tegra.so
04-03 10:58:27.235: D/OpenGLRenderer(28250): Enabling debug mode 0
04-03 10:59:28.245: I/dalvikvm(28341): Debugger is active
04-03 10:59:28.435: I/System.out(28341): Debugger has connected
04-03 10:59:28.435: I/System.out(28341): waiting for debugger to settle...
04-03 10:59:28.635: I/System.out(28341): waiting for debugger to settle...
04-03 10:59:28.835: I/System.out(28341): waiting for debugger to settle...
04-03 10:59:29.035: I/System.out(28341): waiting for debugger to settle...
04-03 10:59:29.235: I/System.out(28341): waiting for debugger to settle...
04-03 10:59:29.435: I/System.out(28341): waiting for debugger to settle...
04-03 10:59:29.635: I/System.out(28341): waiting for debugger to settle...
04-03 10:59:29.835: I/System.out(28341): debugger has settled (1349)
04-03 10:59:30.085: I/System.out(28341): 10:59:29,983 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [assets/logback.xml] at [assets/logback.xml]
04-03 10:59:30.085: I/System.out(28341): 10:59:30,100 |-INFO in ch.qos.logback.classic.joran.action.FindIncludeAction - Path found [jar:file:/data/app/dev.demo.DemoWeirdLog-1.apk!/assets/logback-fails_Inc.xml]
04-03 10:59:30.095: I/System.out(28341): 10:59:30,105 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil@417abda8 - Adding [jar:file:/data/app/dev.demo.DemoWeirdLog-1.apk!/assets/logback-fails_Inc.xml] to configuration watch list.
04-03 10:59:30.115: I/System.out(28341): 10:59:30,109 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@417ac1d8 - URL [jar:file:/data/app/dev.demo.DemoWeirdLog-1.apk!/assets/logback-fails_Inc.xml] is not of type file
04-03 10:59:30.145: D/dalvikvm(28341): GC_CONCURRENT freed 302K, 9% free 7404K/8071K, paused 12ms+12ms, total 43ms
04-03 10:59:30.245: I/System.out(28341): 10:59:30,250 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.android.LogcatAppender]
04-03 10:59:30.245: I/System.out(28341): 10:59:30,254 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [logcat]
04-03 10:59:30.285: I/System.out(28341): 10:59:30,298 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
04-03 10:59:30.415: I/System.out(28341): 10:59:30,429 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
04-03 10:59:30.425: I/System.out(28341): 10:59:30,433 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [TraceLog]
04-03 10:59:30.615: D/dalvikvm(28341): GC_CONCURRENT freed 381K, 10% free 7470K/8263K, paused 11ms+12ms, total 34ms
04-03 10:59:30.795: I/System.out(28341): 10:59:30,804 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
04-03 10:59:30.975: I/System.out(28341): 10:59:30,989 |-INFO in ch.qos.logback.core.FileAppender[TraceLog] - File property is set to [/sdcard/dev.demo.DemoWeirdLog/logs/demo_trace.log]
04-03 10:59:30.985: I/System.out(28341): 10:59:30,996 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [dev.demo] to TRACE
04-03 10:59:30.995: I/System.out(28341): 10:59:31,001 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [dev.demo.DemoWeirdLog] to null, i.e. INHERITED
04-03 10:59:30.995: I/System.out(28341): 10:59:31,005 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [dev.demo.DemoWeirdLog.MainActivity] to null, i.e. INHERITED
04-03 10:59:30.995: I/System.out(28341): 10:59:31,008 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
04-03 10:59:31.005: I/System.out(28341): 10:59:31,015 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@46:64 - no applicable action for [appender], current ElementPath  is [[appender]]
04-03 10:59:31.015: I/System.out(28341): 10:59:31,022 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@56:18 - no applicable action for [encoder], current ElementPath  is [[appender][encoder]]
04-03 10:59:31.015: I/System.out(28341): 10:59:31,029 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@61:22 - no applicable action for [pattern], current ElementPath  is [[appender][encoder][pattern]]
04-03 10:59:31.025: I/System.out(28341): 10:59:31,036 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@66:25 - no applicable action for [root], current ElementPath  is [[root]]
04-03 10:59:31.035: I/System.out(28341): 10:59:31,043 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@67:43 - no applicable action for [appender-ref], current ElementPath  is [[root][appender-ref]]
04-03 10:59:31.035: W/System.err(28341): Failed to instantiate [ch.qos.logback.classic.LoggerContext]
04-03 10:59:31.035: W/System.err(28341): Reported exception:
04-03 10:59:31.035: W/System.err(28341): java.util.EmptyStackException
04-03 10:59:31.035: W/System.err(28341):    at java.util.Stack.pop(Stack.java:73)
04-03 10:59:31.035: W/System.err(28341):    at ch.qos.logback.core.joran.spi.Interpreter.endElement(Unknown Source)
04-03 10:59:31.035: W/System.err(28341):    at ch.qos.logback.core.joran.spi.Interpreter.endElement(Unknown Source)
04-03 10:59:31.035: W/System.err(28341):    at ch.qos.logback.core.joran.spi.EventPlayer.play(Unknown Source)
04-03 10:59:31.035: W/System.err(28341):    at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Unknown Source)
04-03 10:59:31.035: W/System.err(28341):    at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Unknown Source)
04-03 10:59:31.035: W/System.err(28341):    at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Unknown Source)
04-03 10:59:31.035: W/System.err(28341):    at ch.qos.logback.classic.util.ContextInitializer.autoConfig(Unknown Source)
04-03 10:59:31.035: W/System.err(28341):    at org.slf4j.impl.StaticLoggerBinder.init(Unknown Source)
04-03 10:59:31.045: W/System.err(28341):    at org.slf4j.impl.StaticLoggerBinder.<clinit>(Unknown Source)
04-03 10:59:31.045: W/System.err(28341):    at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
04-03 10:59:31.045: W/System.err(28341):    at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
04-03 10:59:31.045: W/System.err(28341):    at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)
04-03 10:59:31.045: W/System.err(28341):    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
04-03 10:59:31.045: W/System.err(28341):    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
04-03 10:59:31.045: W/System.err(28341):    at dev.demo.DemoWeirdLog.MainActivity.<init>(MainActivity.java:17)
04-03 10:59:31.045: W/System.err(28341):    at java.lang.Class.newInstanceImpl(Native Method)
04-03 10:59:31.045: W/System.err(28341):    at java.lang.Class.newInstance(Class.java:1319)
04-03 10:59:31.045: W/System.err(28341):    at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
04-03 10:59:31.045: W/System.err(28341):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
04-03 10:59:31.045: W/System.err(28341):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
04-03 10:59:31.045: W/System.err(28341):    at android.app.ActivityThread.access$600(ActivityThread.java:130)
04-03 10:59:31.045: W/System.err(28341):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
04-03 10:59:31.045: W/System.err(28341):    at android.os.Handler.dispatchMessage(Handler.java:99)
04-03 10:59:31.045: W/System.err(28341):    at android.os.Looper.loop(Looper.java:137)
04-03 10:59:31.055: W/System.err(28341):    at android.app.ActivityThread.main(ActivityThread.java:4745)
04-03 10:59:31.055: W/System.err(28341):    at java.lang.reflect.Method.invokeNative(Native Method)
04-03 10:59:31.055: W/System.err(28341):    at java.lang.reflect.Method.invoke(Method.java:511)
04-03 10:59:31.055: W/System.err(28341):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
04-03 10:59:31.055: W/System.err(28341):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
04-03 10:59:31.055: W/System.err(28341):    at dalvik.system.NativeStart.main(Native Method)
04-03 10:59:31.075: I/System.out(28341): 10:59:31,070 |-WARN in Logger[dev.demo.DemoWeirdLog.MainActivity] - No appenders present in context [default] for logger [dev.demo.DemoWeirdLog.MainActivity].
04-03 10:59:31.085: D/dalvikvm(28341): GC_CONCURRENT freed 427K, 11% free 7493K/8327K, paused 12ms+2ms, total 27ms
04-03 10:59:31.185: D/libEGL(28341): loaded /system/lib/egl/libEGL_tegra.so
04-03 10:59:31.195: D/libEGL(28341): loaded /system/lib/egl/libGLESv1_CM_tegra.so
04-03 10:59:31.205: D/libEGL(28341): loaded /system/lib/egl/libGLESv2_tegra.so
04-03 10:59:31.225: D/OpenGLRenderer(28341): Enabling debug mode 0

@DevByStarlight DevByStarlight reopened this Apr 3, 2014
tony19 added a commit that referenced this issue Apr 7, 2014
A configuration error occurred when an included configuration was
enclosed in a <configuration> or <included> tag. The closing tag
of that enclosure was not detected and thus not removed from the
XML doc, which caused it to propagate to the parent config, leading
to an XML parsing error. This was seen as a confusing error to the
user:

   Failed to instantiate [ch.qos.logback.classic.LoggerContext]

The problem was that the SaxEvent's qName was not populated for
the closing tag of the included config. However, the localName
was properly set. The IncludeAction now checks the qName and falls
back to localName if needed.

Fixes Issue #66
@tony19
Copy link
Owner

tony19 commented Apr 7, 2014

Thanks for the details. I found the bug, and it should be fixed now in 7916e7e.

@tony19 tony19 closed this as completed Apr 7, 2014
@DevByStarlight
Copy link
Author

Yay!
Glad to help.

@tony19 tony19 added the bug label Jul 30, 2014
@lock
Copy link

lock bot commented Feb 27, 2019

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.

@lock lock bot added the archived label Feb 27, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants