Open atm84a opened 1 year ago
It is possible to do this but currently only the path to the configuration file is used. This would require parsing the supervisor file, and any failure in that process would prevent the logger from working.
I can prepare a PR with that change if you have no objections.
Parsing a config file is pretty straightforward:
Than we can initialize service logger with a log file path from the config. In case of config reading failure we can keep existing behavior after a bit of restructuring like below:
It is possible to use the system registry and pass this path right when installing the service. Parsing the supervisor file can cause a lot of failures.
An important point is to have a valid path and keep the existing file name. Validate the directory with Argparser.
Currently the location and name of Supervisor Windows service log is "hardcoded" in supervisor/services.py and is the same as location of a configuration file:
This way we have logs scattered in different places over filesystem w/o a possibility for bulk archiving. It would be convenient to be able to configure Windows service log in supervisord.conf file along with the regular supervisor like below (service_logfile is a proposal):