Writing Logs to external file/s
See original GitHub issueExpected Behavior
We used to be able to separate output log, info & exception info to different logs (with for example supervisor) std_err & std_out.
while true; do
pkill -f pokecli
eval "python pokecli.py --config configs/config.json >> logs/log.txt" &
eval "python pokecli.py --config configs/config1.json >> logs/log1.txt" &
sleep 1800
done
I’m using this bash script for restarting the bots every 30 minutes. It used to keep the logs in the separate files but i guess after the changes to the logging logic it doesn’t do the same. I call my bash script with this command. “nohup ./run.sh >> logs/restart.txt &” it was logging the exceptions into “restart.txt” and other stuff into respective log files but not anymore. Everything goes into restart.txt right now.
Can we add a config option like “pathToLogFile: ‘./logs/log.txt’” and keep the logs in there? It may work as now when this config is not specified or false.
Edited by mod: To clarify other user wanted features
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Yes I can, but not right now. I think I can do it in a few hours.
I use this in pokecli.py:
These settings log bot to console and screen, rotating the file daily.
It also changes the formatter from
to
resulting in this type of log:
The drawback is that you get color codes inside the log file, but i like it when I need to “cat” or “less -R” the log.