Aimeedeer / realtps

https://realtps.net
MIT License
93 stars 25 forks source link

Add file logging with rotation #32

Closed brson closed 1 year ago

brson commented 2 years ago

Right now logging just goes to the console. This makes it real hard to search the logs after the fact, impossible if the machine goes down.

Add file logging, in addition to console logging. The files need to be periodically rotated too - old logs renamed, and the log begun fresh, old-old logs deleted. The file logging needs to work with the env_logger so we can still do console logging, or maybe we can switch to a logger that does both.

Since we run all the jobs as separate processes, we'll need to make sure the file logger performs append operations on the shared log file so it is correctly used concurrently.

Aimeedeer commented 1 year ago

done