6 days ago
I noticed when I try to filter here with: @level:warn all the logs disappear even though there are logs with level warning. What can I do?
6 Replies
6 days ago
Hey, you would need structured JSON logs with the level attribute for Railway to filter by attributes. https://docs.railway.com/guides/logs#structured-logs
Hey, currently I use this library for logging: https://github.com/apple/swift-log
So I assumed this would be enough to provide the needed metadata.
6 days ago
Sorry, but if this doesn't support JSON logging then it is not going to work.
Ah okay, thanks.
Or do you know if it's possible to create custom filters for these levels? Or even OTel support?
6 days ago
If you are using plaintext logs then you need to do a plaintext search - "[ WARNING ]"
Would it be also possible to set alarms to it?
So that either when within 5min 2 "[ WARNING ]" or "[ Error ]" gets logged to the console or based on http staus codes?