a year ago
I am in the process of migrating from Logrus to Slog in my go application. I am using the NewJSONHandler method to initialise the logger and I set the logger as the default in init()
When I immediately log (using [slog.Info](slog.Info)) after initialising the new default, I only receive the message.
Why I'm wondering if this is a Railway issue is:
a) Even the default logger prepends "INFO" to the message
b) Using this approach in the rest of my infrastructure (not running on Railway) works correctly
If this doesn't sound like an issue with your logs I'm happy to continue debugging, but I just wanted to rule it out 🙂
Thanks!
12 Replies
Also while I'm here, I don't have pro plan. I briefly upgraded but my role on discord has never been removed
a year ago
can you show me a screenshot of what your log looks like expanded?
Sigh… I didn't realise you could expand the logs 😅
Thanks for the help again Brody 🙏
a year ago
how could we have made that more visually obvious?
I think part of why I didn't end up expanding the log is that previously with logrus I wasn't using JSON logging so when I did expand the logs in the past I would just see:
deployment: 31325692-cfbf-4a1d-af09-dbb1c6e0a28a
replica: 0195d686-91f3-46a2-a6c8-437c84f7201b
service: 5d663c81-9cc5-4209-87f6-d81b06b48e83I assumed expanding the log just showed Railway metadata.
Maybe it's the FE experience in me but, in front of the log message adding a {...} or similar? Also allowing click on the whole log instead of just the little "+" would be great! 🙂

a year ago
what if we showed that plus icon on logs that have extra JSON attributes, instead of only showing on hover
a year ago
no problem, I'll bring that UI change up to our product team to see if they like the idea too
a year ago
but for now, I'll mark this as solved, feel free to open a new thread if you have anymore questions
a year ago
!s
Status changed to Solved brody • about 1 year ago