Logtash dont capture Logger.error logs using logback


(Sawyer Ford) #1

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>

(Magnus B├Ąck) #2

You've already asked that question in Logtash dont capture Logger.error logs. Please don't ask the same question multiple times.


(Sawyer Ford) #3

This question I would like to close. My actual quries and issues faced are in other thread. Its in here


(system) #5

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