-
Notifications
You must be signed in to change notification settings - Fork 45
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
Adding custom properties, that change during processing #73
Comments
@burning-papaya I don't see many other options than If you're tied to Log4j2 and need to log these events with other appenders, custom |
@rfoltyns Thank you, for your reply. Could you please elaborate on the last sentence (direct usage of
|
You can use parts of programmatic config test and use this library like this: asyncBatchDelivery.add(indexName, itemSourceFactory.create(instanceOfYourClass, objectWriter));
|
@burning-papaya If you haven't made any progress yet, I think that you might be interested in this. What you described is achievable with Log4j2 params and unwrapping serializers. |
Description
I want to add custom fields into logging object, but adding it into
ThreadContext
is not an option. I have to log HTTP requests to external services, and I want to log fields likeurl
,verb
,headers
, etc. There might be several sequential requests with different urls, verbs, so adding those fields intoThreadContext
makes no sense. As of now i log them as part of message.Configuration
log4j2.xml:
Note: Other appenders and their configs are omitted
Note: traceId is injected into Thread context
index_template.json
Runtime (please complete the following information):
Additional context
I have surfed through other related issues. Most of the time people got satisfied with
ThreadContext
solution, unfortunately this is not my case. As far as I understood writing my own mix-in will not work either. I was thinking to implement my own custom lookup just wanted to be sure that I am on the right path and there are not more trivial solutions that I have missed.The text was updated successfully, but these errors were encountered: