feat(zlog)!: JSON formatted logging #1

Manually merged
bitsyndicate merged 4 commits from zlog-json into main 2025-04-20 18:26:17 +00:00
Owner

At the moment, zlog only supports a single string format for logs:

LOG_LEVEL message

This PR introduces JSON logging support through the new json feature, which adds serde, serde_json, and chrono as dependencies. This enhancement allows for custom1 fields when logging and makes Zenyx's log output more searchable, as individual fields can be queried rather than relying on string searches.

Note that this is a breaking change, as both the configuration and calling convention have been modified to accommodate custom fields and their values1.


  1. Custom fields have been determined to be outside of the scope of this PR and will be added in a future PR. This also means that this is no longer a breaking change. ↩︎

At the moment, zlog only supports a single string format for logs: ``` LOG_LEVEL message ``` This PR introduces JSON logging support through the new `json` feature, which adds `serde`, `serde_json`, and `chrono` as dependencies. This enhancement allows for ~~custom~~[^1] fields when logging and makes Zenyx's log output more searchable, as individual fields can be queried rather than relying on string searches. ~~Note that this is a breaking change, as both the configuration and calling convention have been modified to accommodate custom fields and their values~~[^1]. [^1]: Custom fields have been determined to be outside of the scope of this PR and will be added in a future PR. This also means that this is no longer a breaking change.
lily self-assigned this 2025-04-19 07:16:44 +00:00
lily added this to the Zenyx project 2025-04-19 07:16:45 +00:00
lily added
Testing
Required
and removed
Testing
Not needed
labels 2025-04-19 08:22:00 +00:00
lily added 1 commit 2025-04-19 17:45:07 +00:00
lily force-pushed zlog-json from abc3a54084 to 339c9ee2c2 2025-04-19 17:48:35 +00:00 Compare
lily changed title from WIP: feat(zlog)!: json formatted logging to feat(zlog)!: json formatted logging 2025-04-19 17:53:48 +00:00
requested reviews from caznix, bitsyndicate 2025-04-19 17:54:06 +00:00
bitsyndicate force-pushed zlog-json from 339c9ee2c2 to 0d98f633a0 2025-04-19 19:37:59 +00:00 Compare
lily force-pushed zlog-json from 0d98f633a0 to 9f8633ff62 2025-04-19 19:39:28 +00:00 Compare
lily added 1 commit 2025-04-19 20:07:13 +00:00
lily changed title from feat(zlog)!: json formatted logging to feat(zlog)!: JSON formatted logging 2025-04-19 20:12:25 +00:00
bitsyndicate requested changes 2025-04-19 20:13:37 +00:00
Dismissed
src/main.rs Outdated
@ -489,1 +488,3 @@
.log_to_stdout(true)
.colored_stdout(false)
.log_to_stdout(false)
.log_use_json(true)
Owner

Can we not use json by default, it makes looking at stdout logs while developing a bit painful as color is a useful visual differentiator

Can we not use json by default, it makes looking at stdout logs while developing a bit painful as color is a useful visual differentiator
lily marked this conversation as resolved
lily added 1 commit 2025-04-19 20:16:07 +00:00
requested review from bitsyndicate 2025-04-19 20:16:26 +00:00
bitsyndicate approved these changes 2025-04-19 20:16:35 +00:00
Dismissed
lily added 1 commit 2025-04-19 20:39:58 +00:00
lily dismissed bitsyndicate's review 2025-04-19 20:39:58 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

lily 2025-04-19 20:45:54 +00:00
bitsyndicate referenced this pull request from a commit 2025-04-20 18:26:17 +00:00
bitsyndicate manually merged commit 415cc477f7 into main 2025-04-20 18:26:17 +00:00
lily referenced this pull request from a commit 2025-04-21 22:48:25 +00:00
bitsyndicate referenced this pull request from a commit 2025-04-22 18:37:26 +00:00
bitsyndicate referenced this pull request from a commit 2025-04-22 19:07:15 +00:00
bitsyndicate referenced this pull request from a commit 2025-04-22 19:59:25 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: nonsensical-dev/zenyx-engine#1
No description provided.