astroufsc / chimera

Chimera - Observatory Automation System
http://chimera.sf.net/
GNU General Public License v2.0
36 stars 18 forks source link

Improve logging #168

Open wschoenell opened 7 years ago

wschoenell commented 7 years ago

I am having this error when running Chimera on Windows, but it is probably an error for the other OSes. In doRollover() it sometimes complains that the file is already open by another process. This is probably due to multiple concurrent threads running in the same log file.

screen shot 2017-06-06 at 1 14 21 pm
wschoenell commented 7 years ago

A solution may include changing Python's default RotatingFileHandler for the ConcurrentLogHandler alternative module.

https://github.com/astroufsc/chimera/blob/4c92d4624666e8b785c867dbcfe04c35db843ca9/src/chimera/core/log.py#L75-L78

Some source of info: https://github.com/evilhero/mylar/issues/893 https://stackoverflow.com/questions/37402702/log-rotation-python-and-windows