WHAT IS YOUR FAVORITE LOGGER?
Hi all 👋
I'd love to know what is the 'best' logging solution I can use in my T3 app?
Also, a few weeks ago there was some talk that a good error handling tutorial is needed, do you know of a good resource to learning best practices in error handling?
Thank you for your time!
38 Replies
P.S. I know about axiom.io for centerlized logging but I mean what do use insids your code?
Solution
console.log
console
for rust:
panic(<message>)
<pre>{content}</pre}
and then window.print()
Oh shoot. It's one of those questions 😬
no, genuinely it is, others may disagree, but i rely more on my log ingest tools such as cloudwatch
ive never bothered to setup a logger personally
just
console.log
console.error
and some times console.warn
. cases where i might consider using a logger is when i wan to log something for debugging but the thing i want to log is sensitive data such as personally identifiable dataIf you needed a logger, do you have a go-to?
ive never gone to unfortuately
ive heard winston exists /shrug
what features are you looking for?
cus
could surfice
For backend console is sufficient. For front end, I want to see what happened so I need to send log info (Right?)
ohh
sentry?
Yes something like that
Or that 🤔
i was more thinking in terms of a logger for a service
maybe i have zero clue tbh
I’ve always used Winston
And then formatted to add in request ids and timestamps, also Otel packages will auto use loggers like that which is nice (unsure if they do for console.log)
No clue what otel is
Open telemetry
Kinda wanna try it out in trpc and see how well it works
i saw theo shit on sentry and suggested axiom over it. but he talked about backend logs. not sure if axiom is good with frontend logs/error handling
I was talking about loggers in app, if you mean where do you store your logs that’s different question
I’ve mainly used cloud watch and sumo logic in the past
Frontend straight to Sumo
Backend > cloud watch logs > sumologic
Cloud watch is just so easy
The UI sucks tbh, but it works
Agree
Sumologic is a bit more powerful as it’s a dedicated logging solution
So that’s useful
Not heard of it, I'm guessing it just injests logs and let's you do stuff
Pretty much, also allows you to injest metrics and stuff but we mainly used it for logs and creating some dashboards powers by logs
I see nice
And has like a single query place where you can query all logs
We tend to just ust was for that but it's probably harder
I see. Nice
Logging tools are pretty expensive
Aws*
Yeah we were pretty much fully on aws
Yup I guess that's why we use aws got our graphs
Sumo was one of only non aws things
Along with honeycomb
I see
And snowflake
Lol
Snowflake was really a fkn game changer
What does it do
Anyways not really related to question but all those are good things to think about when logging 🙂
Maybe ask in something that isn’t this chat :p
Fair
Recommending https://github.com/unjs/consola
GitHub
GitHub - unjs/consola: 🐨 Elegant Console Logger for Node.js and Bro...
🐨 Elegant Console Logger for Node.js and Browser . Contribute to unjs/consola development by creating an account on GitHub.
looks cool