You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2020/09/02 09:05:34 UTC

[GitHub] [logging-log4j2] vy edited a comment on pull request #335: Import of LogstashLayout as JsonTemplateLayout

vy edited a comment on pull request #335:
URL: https://github.com/apache/logging-log4j2/pull/335#issuecomment-685462219


   @ramazanpolat,
   1. Unless there is a reason to do so, I would avoid custom classes to represent the logging structure. In your case a simple `logger.info(new MapMessage(Map.of("message", message, "userId", userId, "ip", ip)))` fits the bill.
   2. You should have either used `logger.info(new ObjectMessage(customLogBean))` or implement `Message` interface in the `CustomLogBean` class.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org