Getting the following error. Please help me understand What led to this error? #710
-
I have the below configuration in <configuration debug="true" scan="true" scanPeriod="30 seconds">
<springProperty scope="context" name="app_name" source="spring.application.name"/>
<appender name="console"
class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
<jsonGeneratorDecorator class="net.logstash.logback.mask.MaskingJsonGeneratorDecorator">
<defaultMask>********</defaultMask>
<path>*/emailId</path>
<path>*/originalUid</path>
<path>*/mobileNumber</path>
<path>*/dateOfBirth</path>
</jsonGeneratorDecorator>
<providers>
<timestamp/>
<version/>
<logLevel/>
<logLevelValue/>
<context/>
<loggerName/>
<threadName/>
<message/>
<arguments/>
<pattern>
<omitEmptyFields>true</omitEmptyFields>
<pattern>
{
"host_name": "%mdc{host_name}",
"traceId": "%mdc{traceId}",
"spanId": "%mdc{spanId}",
"body": "#asJson{%mdc{body}}",
"x-requester-id": "%mdc{X-Requester-ID}",
"AD-GUID": "%X{AD.requestGUID}"
}
</pattern>
</pattern>
</providers>
</encoder>
</appender>
<appender name="async" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="console"/>
</appender>
<root level="info">
<appender-ref ref="async"/>
</root>
<logger name="com.manindra" level="trace" additivity="false">
<appender-ref ref="async"/>
</logger>
</configuration> And I am using SLF4J logger |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, Thanks for the feedback.
This likely comes from an object you added to the log via the As a side note I notice you are using Logback's native Async support ( Also make sure you upgrade to the latest version of logstash-logback-encoder. It contains a lot of improvements in various areas and may also sometimes give more informative error message in case of issues. Feel free to post any feedback if we can help. |
Beta Was this translation helpful? Give feedback.
Hi,
Thanks for the feedback.
As far as I can tell, the problem is caused by Jackson that complains about a cycle in the object graph to serialise. See:
This likely comes from an object you added to the log via the
StructuredArguments
feature. There is unfortunately not much logstash-logback-encoder can do about it... You should definitely look at what solution Jackson has to offer to work around this situation.As a s…