Open Bugslive opened 4 months ago
Hello @Romakita. Do you think this request could be merged ? We would appreciate to have this minor evolution.
Hello @Bugslive But changing the order assignment will allow data to override level, categoryName and startTime fields.
So I can't accept the change right know
Hello @Romakita. I made an improvement to prevent startTime, level and categoryName to be overridden. I also had a corresponding test.
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