Logtash dont capture Logger.error logs

Below is the configuration of logback.xml I tried many ways but it does not encode or print Logger.error statements

       <configuration>
<property name="LOG_PATH" value="/tmp/json-log.json" />
<appender name="jsonAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <File>${LOG_PATH}</File>
    <encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
    <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
        <maxIndex>1</maxIndex>
        <fileNamePattern>${LOG_PATH}.%i</fileNamePattern>
    </rollingPolicy>
    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
        <MaxFileSize>1MB</MaxFileSize>
    </triggeringPolicy>
</appender>
<logger name="jsonLogger" additivity="false" level="DEBUG">
    <appender-ref ref="jsonAppender"/>
</logger>
<root level="INFO">
    <appender-ref ref="jsonAppender"/>
</root>
<root level="error">
    <appender-ref ref="jsonAppender" />
</root>
<appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender">
    <encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>
<logger name="jsonLogger" additivity="false" level="DEBUG">
    <appender-ref ref="consoleAppender"/>
</logger>
<root level="INFO">
    <appender-ref ref="consoleAppender"/>
</root>
<appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender">
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
        <level>ERROR</level>
    </filter>
    <target>System.err</target>
    <encoder class="net.logstash.logback.encoder.LogstashEncoder">
    </encoder>
</appender>
<root level="ERROR">
    <appender-ref ref="STDERR" />
</root>

Are log entries missing from /tmp/json-log.json? Or are they present in that file but ignored by Logstash?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.