Trouble with logging

I tried to modify the logback.xml file to add in the z-wave info output to another file (as the wiki on the z-wave binding advises), but it had no effect on my logs. I typed in the addition, when that did not work, I did a cut and paste to make sure I didn’t mistype anything and still no luck. When my log file got too large (null pointer errors from an items file), I tried to change the logback.xml again to do more frequent log rotation.

When I did this, all logging stopped. The last log is timestamped at 9:30 this morning (when I stopped openhab) to make the changes in the logback.xml. I restarted openhab and the only thing that is updating in the /var/log/openhab/ folder is the 2015_12_27.request.log.

Any help would be appreciated!

~John

Edit:
PS: Using raspbian w/ openhab 1.7.1 on a Raspberry Pi 2, also, a reboot didn’t help.

Ok, re-installed openHAB, now logging is working as expected, now back to the drawing board!

Always make a backup of a config file when making edits so you can just copy the backup over your mangled copy.

It sounds like you may have had a syntax error in your file when you made your initial edit which got carried over for each subsequent edit until the logger was completely broken.

Here is my logback.xml file which shunts the zwave and nest logs to separate files, for reference.

<configuration scan="true">

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
            <encoder>
                    <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-30.30logger{36}] - %msg%n</pattern>
            </encoder>
    </appender>

    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
            <file>${openhab.logdir:-logs}/openhab.log</file>
            <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
                    <!-- weekly rollover and archiving -->
                    <fileNamePattern>${openhab.logdir:-logs}/openhab-%d{yyyy-ww}.log.zip</fileNamePattern>
                    <!-- maximum number of archive files to keep -->
                    <maxHistory>30</maxHistory>
            </rollingPolicy>
            <encoder>
                    <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-30.30logger{36}] - %msg%n %nopex</pattern>
            </encoder>
    </appender>

    <appender name="EVENTFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
            <file>${openhab.logdir:-logs}/events.log</file>
            <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
                    <!-- weekly rollover and archiving -->
                    <fileNamePattern>${openhab.logdir:-logs}/events-%d{yyyy-ww}.log.zip</fileNamePattern>
                    <!-- maximum number of archive files to keep -->
                    <maxHistory>30</maxHistory>
            </rollingPolicy>
            <encoder>
                    <pattern>%d{yyyy-MM-dd HH:mm:ss} - %msg%n</pattern>
            </encoder>
    </appender>

    <appender name="ZWAVEFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${openhab.logdir:-logs}/zwave.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>logs/zwave-%d{yyyy-ww}.log.zip</fileNamePattern>
            <maxHistory>30</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-30.30logger{36}:%-4line]- %msg%n</pattern>
        </encoder>
    </appender>

    <appender name="NESTFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${openhab.logdir:-logs}/nest.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>logs/nest-%d{yyyy-ww}.log.zip</fileNamePattern>
            <maxHistory>30</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-30.30logger{36}:%-4line]- %msg%n</pattern>
        </encoder>
    </appender>

    <!-- Change DEBUG->TRACE for even more detailed logging -->

    <logger name="org.openhab.binding.zwave" level="DEBUG" additivity="false">
        <appender-ref ref="ZWAVEFILE" />
    </logger>

    <logger name="org.openhab.binding.nest" level="TRACE" additivity="false">
        <appender-ref ref="NESTFILE" />
    </logger>

    <logger name="runtime.busevents" level="INFO" additivity="false">
            <appender-ref ref="EVENTFILE" />
            <appender-ref ref="STDOUT" />
    </logger>

    <logger name="org.openhab" level="INFO"/>

    <!-- this class gives an irrelevant warning at startup -->
    <logger name="org.atmosphere.cpr.AtmosphereFramework" level="ERROR" />

    <!-- temporary workaround for https://github.com/openhab/jmdns/issues/12 -->
    <logger name="javax.jmdns" level="OFF"/>

    <!-- temporary workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=402750 -->
    <logger name="OSGi" level="OFF" />

    <!-- temporary workaround to circumvent error messages with any obvious effect -->
    <logger name="org.atmosphere.cpr.AtmosphereFramework" level="OFF" />
    <logger name="org.atmosphere.cpr.DefaultAnnotationProcessor" level="OFF" />
    <logger name="org.eclipse.jetty.io.nio" level="ERROR"/>

    <root level="WARN">
            <appender-ref ref="FILE" />
            <appender-ref ref="STDOUT" />
    </root>

</configuration>

Notice that it must be valid XML. Also notice the order of the elements. Appenders go first, then loggers. To get the log files separated you need to assigned your appenders to the given logger.

Thank you Rich, I copied yours and keep it as a text file so I can refer to it and make mods that I need to test! It is much appreciated!