Info logs are not reported, if instrumented via Servlet(RequestLoggingFilter)
swatiSumn opened this issue · 3 comments
Description: Our service is integrated with sap-app-logging-service(latest version). And we are able to see error logs, but are unable to see the info logs in kibana dashboard.
The logback.xml looks something like this:
<configuration debug="false" scan="false"> <appender name="STDOUT-JSON" class="ch.qos.logback.core.ConsoleAppender"> <encoder class="com.sap.hcp.cf.logback.encoder.JsonEncoder" /> </appender> <!-- for local development, you may want to switch to a more human-readable layout --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%d %-5level [%thread] %logger{0} [%mdc]>: %msg %replace(%xEx){'\n', ' | '}%nopex%n</pattern> </encoder> </appender> <root level="${LOG_ROOT_LEVEL:-INFO}"> <!-- Use 'STDOUT' instead for human-readable output --> <appender-ref ref="STDOUT-JSON" /> </root> <!-- request metrics are reported using INFO level, so make sure the instrumentation loggers are set to that level --> <logger name="com.sap.hcp.cf" level="INFO" /> <turboFilter class="com.sap.hcp.cf.logback.filter.CustomLoggingTurboFilter" /> </configuration>
Can you let us know why we are not able to see info logs?
Hi,
so far your configuration seems fine. However our example contains the variable LOG_ROOT_LEVEL. That can be set to override the root log level i.e. via java -DLOG_ROOT_LEVEL="WARN" .... Please check, whether this is the case. You can substitute "${LOG_ROOT_LEVEL:-INFO}" by "INFO", if you do not need this feature. Let me know, if this changes the behaviour.
Best Regards,
Karsten
Hi KarstenSchnitter
I tried the way you suggested, substituting "${LOG_ROOT_LEVEL:-INFO}" by "INFO", but still I am not able to see info logs.
Latest logback.xml looks like this:
<configuration debug="false" scan="false"> <appender name="STDOUT-JSON" class="ch.qos.logback.core.ConsoleAppender"> <encoder class="com.sap.hcp.cf.logback.encoder.JsonEncoder" /> </appender> <!-- for local development, you may want to switch to a more human-readable layout --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%d %-5level [%thread] %logger{0} [%mdc]>: %msg %replace(%xEx){'\n', ' | '}%nopex%n</pattern> </encoder> </appender> <root level="INFO"> <!-- Use 'STDOUT' instead for human-readable output --> <appender-ref ref="STDOUT-JSON" /> </root> <!-- request metrics are reported using INFO level, so make sure the instrumentation loggers are set to that level --> <logger name="com.sap.hcp.cf" level="INFO" /> <turboFilter class="com.sap.hcp.cf.logback.filter.CustomLoggingTurboFilter" /> </configuration>
Hi @swatiSumn,
can you verify, that this is an issue with the logging library and not with the platform? You can use cf logs your_app to inspect the current logs emitted by your app. Do those logs contain the required logs? If possible you could also start the app locally to verify the behaviour of the library.
Best Regards,
Karsten