Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Work In Progress integration test draft #12
Work In Progress integration test draft #12
Changes from all commits
9318e7e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually this line which is wrong. It works when setting the
currentContext
parameter to false.If that's feasible, it would be much simpler and also more performant to not support pattern layouts within
EcsLayout
. Pattern layouts are meant to be used for the whole message. Using them for an alternative to lookups would be kind of a hack.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should still support pattern converters as they would be a great way to extend the ECSLayout. I understand that the ECS is expecting some fields formatted in one way, but at the same time apps using it have requirements and user's expectation that we want to maintain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Performance wise I think there should not be a difference. we can always measure this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In contrast to other libraries, this one is opinionated towards ECS. If users want to customize the field name where the logger name is stored, this is probably not the library for them. I see ECS as a protocol which this library conforms to.
Also, just by providing the ability to resolve an additional property like this
Does not remove the default
log.logger
ECS field.On the other hand, it doesn't do much harm and it's easier to integrate than I have originally thought. So I went ahead and created a PR for it: #24
I would still suggest relying on lookups as opposed to pattern converters in Elasticsearch as lookups are more widely supported by various other libraries. Also note, that something like the
%node_and_cluster_id
or%exceptionAsJson
pattern would not work here, as the value will always be JSON encoded.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at the same time ECS is a permissive schema, we will definitely have fields which are not defined there.
If elasticsearch is to be migrated to ECS Layout then obviously we want to make sure all the current use cases work. I would prefer to avoid maintaining 3 layouts at the same time. (we still maintain plain text logs)
I am worried that
%exceptionAsJson
would not work. Lots of users or developers still rely on visually checking logs and having an unreadable exception + stacktrace would be bad experience for them.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a PR to serialize the stackTraceAsArray: #28