samber / slog-nats

🚨 slog: NATS handler
https://pkg.go.dev/github.com/samber/slog-nats
MIT License
10 stars 2 forks source link

integrations #2

Open gedw99 opened 11 months ago

gedw99 commented 11 months ago

Hey @samber

code works great at the moment. I am new to slog btw.

What's the best way to quickly get slog and nats working together for dog fooding features ?

If I had to guess, a typical dev would want to log to a nats leaf locally. The leaf would then under the hood sync the logs to some central server. This makes everything very async and so gives cpu and men back to the main app as quickly as possible.

https://docs.nats.io/running-a-nats-service/configuration/leafnodes has good info on it.

samber commented 11 months ago

I have no opinion since I never put NATS into production in any project.

The local log aggregators I know, are just some agent that are responsible for reading the logs in syslog, text files, etc...

Pushing to a local NATS server with proxying to a global cluster is not a common pattern, but i may be wrong since i probably not have as much experience as you with this message broker.

I there any consideration about this lib ? Does it require some changes ?

gedw99 commented 11 months ago

changes

I have no opinion since I never put NATS into production in any project.

Well, I reckon this might be useful to NATS devs, since slog is first class golang std.

The local log aggregators I know, are just some agent that are responsible for reading the logs in syslog, text files, etc...

I log directly from the main app to NATS. Don't both hitting disk at all. Large Hyperscalers do this too like fly.io as far as I know. Mastercard and Telecoms run NATS also. No idea how they log.

Pushing to a local NATS server with proxying to a global cluster is not a common pattern, but i may be wrong since i probably not have as much experience as you with this message broker.

"Leaf nodes are useful in IoT and edge scenarios" aqs per its says in the link I sent. It's quite common to not use docker in edge cases. Been edge this way for a few years and before that with Tibco Rendezvous which is where NATS came from. Because NATS is so light and self protecting from the Sec ops POI, docker is not required on edge IMHO.

I there any consideration about this lib ? Does it require some changes ?

I don't think so right now. Early days though. I will work up an integration, and can feedback.

samber commented 11 months ago

I'm not sure to get the point of this issue.

Is there a different way to connect to a NATS server or local NAT leaf node?