Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing to log file does not work when running multiple vaccipy instances #484

Open
Spenhouet opened this issue Jun 16, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@Spenhouet
Copy link

Spenhouet commented Jun 16, 2021

The logging for vaccipy does currently not create a config specific log file.
If you run multiple vaccipy instances (e.g. for the different groups) it fails when trying to write to the log file:

--- Logging error ---
Traceback (most recent call last):
File "C:\Users\XXXX\AppData\Local\Programs\Python\Python37\lib\logging\handlers.py", line 70, in emit
self.doRollover()
File "C:\Users\XXXX\AppData\Local\Programs\Python\Python37\lib\logging\handlers.py", line 394, in doRollover
self.rotate(self.baseFilename, dfn)
File "C:\Users\XXXX\AppData\Local\Programs\Python\Python37\lib\logging\handlers.py", line 111, in rotate
os.rename(source, dest)
PermissionError: [WinError 32] Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird: 'C:\Users\XXXX\Documents\vaccipy\tools\log\impfterminservice.log' -> 'C:\Users\XXXX\Documents\vaccipy\tools\log\impfterminservice.log.2021-06-15'

It would be good if the config file name would be included as prefix or postfix in the log name or if a prefix or postfix is configurable in the config file.
Then every instance started with a different config file can write to an individual log file.

More complicated but probably even better would be a log file per PLZ.

@batcats
Copy link

batcats commented Jun 16, 2021

Denn kann ich bestätigen 🙂

PLZ könnte zu aufwendig werden.
Ich persönlich wäre schon mit einem nicht kollidierenden LogFile-Namen zufrieden (z.B. die Prozess-Id oder Startzeit(+Microtime) an den Namen hängen).

@timreibe timreibe added the enhancement New feature or request label Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants