flying7eleven / fenrir-rs

Fenrir is a crate for using Loki for log aggregation which can be used with a logging framework like fern.
MIT License
2 stars 1 forks source link

[Feature]: JSON log serialization #3

Open tazz4843 opened 1 year ago

tazz4843 commented 1 year ago

What's your idea?

Before switching to this crate, I was using tracing-loki (which has its own whole host of issues which were originally the catalyst for me switching, but I digress). This crate output logs in a nicely formatted JSON manner, allowing me to filter logs incredibly easily using the JSON format. Sample output in the attached screenshot. image

When I switched to this crate I noticed I lost all of that, and wrote up a patch on my fork that I'm currently using: https://github.com/tazz4843/fenrir-rs/tree/json-logs

Given that this is a major change, and requires configuration on the user's part that way they don't end up with garbage logs, I figured I would open an issue before making a PR to add this feature if you're interested. It could be locked behind a feature flag if that's something you'd be willing to add.

Code of Conduct

flying7eleven commented 1 year ago

Hey, sorry for the late reply. I wasn't sure about this feature and had to think about it a while to get my bearings. I'm still not completely sure about it but would appreciate a PR for this behind a feature flag (maybe experimental or incubator). I see why this feature would help you (and probably also others).

tazz4843 commented 1 year ago

Sorry this took me so long to get back to. I'll try to make that PR sometime in the next day, shouldn't be too hard to move it behind a feature flag.

flying7eleven commented 11 months ago

So sorry, I completely missed your reply and your PR. I'll get back to merging it as soon as possible