Closed beckermarc closed 2 years ago
Hi,
thanks for reaching out about this issue.
Generation of request logs in the RequestLogger
was refactored to no longer rely on the toString
implementation in RequestRecord. This improves performance in the cloud profile significantly. As a side-effect, the log does no longer contain the JSON representation when not using the libraries JsonEncoder
. This is the reason, why in your non-cloud profile the log messages contains no more representation of the request record.
This behaviour is completely intentional. It avoids an unnecessary generation of a JSON representation of the request log. The previous behaviour cannot easily be reestablished within the automatic instrumentation. You can disable the RequestLogger
logs by setting its logging level to WARN
or higher in the non-cloud scenarios.
You can also contact me directly over SAP internal channels, if you want to discuss this issue further.
Best Regards, Karsten
Okay, as it doesn't seem to be easily possible to automatically disable the RequestLogger in the library, we will add this explicitly to our configuration: https://github.com/SAP-samples/cloud-cap-samples-java/pull/164
Description
In the CAP Java sample application we use a logback-spring.xml file, which enables the JsonEncoder from cf-java-logging-support only when running the Spring Boot application with the
cloud
profile. In all other cases the standard logback configuration file is loaded.With version 3.5.7 the logging library produced request logs even, if the
cloud
profile was not activated. Since 3.6.0 this no longer works. The request logs produced by version 3.5.7 looked like this:With version 3.6.0 the RequestLogger just produces the following output upon every request:
Expectations
Was this an intended feature in 3.5.7 or did this only work accidentally? If it was intended, is it possible to somehow reestablish the behaviour of the previous version? If it wasn't intended, is it possible to somehow deactivate the RequestLogger automatically in those scenarios, as it is rather annoying that an empty log line is generated by it upon every request.
Steps to reproduce
git clone https://github.com/SAP-samples/cloud-cap-samples-java