-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
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
Allow customizing pattern of "message" field for AccessEvents #496
Comments
Hi @nickavv I definitely agree that logstash-logback-encoder could make customizing the message logged for access events easier. Great idea. I just want to let you know that it is possible to do this today by using the See https://github.com/logstash/logstash-logback-encoder#composite-encoderlayout for details on the In your case, you would not add the standard |
Thanks for the comment @philsttr, I just wanted to follow up for anybody having a similar issue that I was able to get things working the way I wanted with your workaround. This is what my encoder looks like in my logback-access.xml file now:
|
I'm also searching for a good way to customize the Something like
|
Yes even though I was able to use the workaround I still think my original ask in the ticket was valuable, being able to customize |
The message field is useful for a number of reasons in applications that consume and display logs. However, the properties that appear in the
message
field are not currently customizable. As per the documentation, the pattern is fixed as:${remoteHost} - ${remoteUser} [${timestamp}] "${requestUrl}" ${statusCode} ${contentLength}
In my particular case, the
remoteUser
property is not allowed to be logged, for security reasons. I've ignored the separateremote_user
field, but I cannot remove that property from themessage
field without ignoring themessage
field entirely.It would be nice if the pattern that the
message
field logged was configurable.The text was updated successfully, but these errors were encountered: