We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello there, is there any possible way to format message parameter as json? Like in log4j2
<JsonTemplateLayout eventTemplateUri="classpath:Log4j2JsonLayout.json" />
quarkus.log.file.enable=true quarkus.log.file.json=true quarkus.log.file.path=log/app.log quarkus.log.file.json.pretty-print=false quarkus.log.file.json.date-format=YYYY-MM-dd HH:mm:ss.SSS quarkus.log.file.json.exception-output-type=formatted
import org.jboss.logging.Logger; ... //writing log as below: logEntry.put("responseBody", responseBody); logEntry.put("elapsed", elapsed); String logMessage = objectMapper.writeValueAsString(logEntry); logger.info(logMessage);
but it escaped json and prints as:
{"timestamp":"2024-11-07 14:55:43.792","sequence":177,"loggerClassName":"org.jboss.logging.Logger","loggerName":"xx.xxx.JsonLogger","level":"INFO","message":"{\"elapsed\":4.332,\"requestHeaders\":{\"empty\":false},\"responseBody\":{\"status\":200,\"entity\":{\"map\":{\"code\":\"000\",\"message\":\"Success\",\"userinfo\": ...
How to fix this?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello there, is there any possible way to format message parameter as json? Like in log4j2
but it escaped json and prints as:
How to fix this?
The text was updated successfully, but these errors were encountered: