-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
refactor(jsonlayout): maintain layout even if data in logger context #253
base: production
Are you sure you want to change the base?
Conversation
- keep startTime, categoryName and level at the beginning of Json object - minor fix in CONTRIBUTING.md
Hello @Romakita. Do you think this request could be merged ? We would appreciate to have this minor evolution. |
Hello @Bugslive So I can't accept the change right know |
startTime: loggingEvent.startTime, | ||
categoryName: loggingEvent.categoryName, | ||
level: loggingEvent.level.toString() | ||
level: loggingEvent.level.toString(), | ||
...loggingEvent.context.toJSON() |
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.
With this change, level, startTime, categoryName can be overridden :(
- keep startTime, categoryName and level at the beginning of Json object - startTime, categoryName and level can not be overridden - minor fix in CONTRIBUTING.md
Hello @Romakita. |
60e4c62
to
c6a3aca
Compare
Informations
Description
keep startTime, categoryName and level at the beginning of Json object when using Json Layout:
This makes it easier to track logs
minor fix in CONTRIBUTING.md
Example
Before:
without additional data in logger context:
{"startTime":"2024-07-10T16:29:22.398Z","categoryName":"TSED","level":"INFO",..., "data":[]}
with additional data in logger context
const context = new LogContext(); context.set("user", "romain");
{"user": romain", "startTime":"2024-07-10T16:29:22.398Z","categoryName":"TSED","level":"INFO",..., "data":[]}
After:
with additional data in logger context
{"startTime":"2024-07-10T16:29:22.398Z","categoryName":"TSED","level":"INFO", "user": romain", ..., "data":[]}
Todos