{
"@timestamp":"2020-10-30T12:40:58.083+02:00",
"@version":"1",
"message":"Example new response log",
"logger_name":"com.ft.upp.logger.UppLoggerTest",
"thread_name":"main",
"level":"DEBUG",
"level_value":10000,
"content_type":"application/json",
"service_name":"example_service",
"user_agent":"dummy-user-agent",
"status":200,
"accept": "application/json"
}
config:
mandatory_fields:
service_name: "example_service"
public void info(final String message, Object... args) {
logInternal(message, m -> logger.info()
.log(m, lazy(() -> entries(this.keyConfig))), args);
}
log.withRequest(<request_object>).info("Example request");
...
log.withResponse(<response_object>).info("Example response");
@CustomLog
public class ExampleApp {
void doSometing(String randomStuff) {
log
.withTransactionId(<tid>)
.withUuid(<uuid>)
.withMethodName("doSomething")
.info("Example" + randomStuff);
}
}