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!
Solution:
console.log
Jump to solution
38 Replies
Mendy
Mendy14mo ago
P.S. I know about axiom.io for centerlized logging but I mean what do use insids your code?
Solution
Anna | DevMiner
Anna | DevMiner14mo ago
console.log
Finn
Finn14mo ago
console for rust: panic(<message>)
Anna | DevMiner
Anna | DevMiner14mo ago
<pre>{content}</pre} and then window.print()
Mendy
Mendy14mo ago
Oh shoot. It's one of those questions 😬
Finn
Finn14mo ago
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 data
Mendy
Mendy14mo ago
If you needed a logger, do you have a go-to?
Finn
Finn14mo ago
ive never gone to unfortuately ive heard winston exists /shrug what features are you looking for? cus
const lOGGER = {
debug: (...thing: unknown[]) => {
if (proccess.env.NODE_ENV !== "production") {
console.log("DEBUG: ", ...thing)
...ect
const lOGGER = {
debug: (...thing: unknown[]) => {
if (proccess.env.NODE_ENV !== "production") {
console.log("DEBUG: ", ...thing)
...ect
could surfice
Mendy
Mendy14mo ago
For backend console is sufficient. For front end, I want to see what happened so I need to send log info (Right?)
Finn
Finn14mo ago
ohh sentry?
Mendy
Mendy14mo ago
Yes something like that Or that 🤔
Finn
Finn14mo ago
i was more thinking in terms of a logger for a service maybe i have zero clue tbh
scot22
scot2214mo ago
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)
Finn
Finn14mo ago
No clue what otel is
scot22
scot2214mo ago
Open telemetry Kinda wanna try it out in trpc and see how well it works
᲼᲼᲼
᲼᲼᲼14mo ago
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
scot22
scot2214mo ago
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
Finn
Finn14mo ago
Cloud watch is just so easy The UI sucks tbh, but it works
scot22
scot2214mo ago
Agree Sumologic is a bit more powerful as it’s a dedicated logging solution So that’s useful
Finn
Finn14mo ago
Not heard of it, I'm guessing it just injests logs and let's you do stuff
scot22
scot2214mo ago
Pretty much, also allows you to injest metrics and stuff but we mainly used it for logs and creating some dashboards powers by logs
Finn
Finn14mo ago
I see nice
scot22
scot2214mo ago
And has like a single query place where you can query all logs
Finn
Finn14mo ago
We tend to just ust was for that but it's probably harder I see. Nice
scot22
scot2214mo ago
Logging tools are pretty expensive
Finn
Finn14mo ago
Aws*
scot22
scot2214mo ago
Yeah we were pretty much fully on aws
Finn
Finn14mo ago
Yup I guess that's why we use aws got our graphs
scot22
scot2214mo ago
Sumo was one of only non aws things Along with honeycomb
Finn
Finn14mo ago
I see
scot22
scot2214mo ago
And snowflake
Finn
Finn14mo ago
Lol
scot22
scot2214mo ago
Snowflake was really a fkn game changer
Finn
Finn14mo ago
What does it do
scot22
scot2214mo ago
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
Finn
Finn14mo ago
Fair
tom
tom14mo ago
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.
Finn
Finn14mo ago
looks cool