Custom logs files
I moved from using
pythonanywhere
to Railway
to host my discord bot.
I used to write logs to files as follows bot.log
, errors.log
, anddb.log
where errors.log contain errors from all other log files for fast errors tracking.
The problem is railway uses docker containers as far as I understand and I am not really into docker.
Is there a way to live read a log file specifically errors.log
from inside the service container? or I just have to change the way I handle logging?Solution:Jump to solution
send info, debug, and warn logs to stdout, they will then appear in the deployment logs
send error logs to stderr, they will appear in red in the deployment logs...
16 Replies
Project ID:
N/A
N/A
Solution
send info, debug, and warn logs to stdout, they will then appear in the deployment logs
send error logs to stderr, they will appear in red in the deployment logs
but yeah you will need to do the tiny change of logging to stdout/stderr instead of files
Considered. Thank you very much.
no problem π
Is there anyway I can
exec
to service container ?there is not, what would you need it for though? maybe we can come up with a work around
Yep, I'll find a way around it. thx.
haha maybe you missed my question there?
I did not. I just realized my reason is stupid enough and there is a way around it.π
tell me anyway π
I just want to get the old log files from the container before the next deployment. but I think they are available in the deployment logs.
if they're also logged to stdout/stderr, they're in the deployment logs, if they where only logged to files, then they're essentially gone
yep they're logged to stdout/stderr.
perfect