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

Python Rotating File Handler Logging Error #377

Open
Isildur981 opened this issue Aug 8, 2024 · 1 comment
Open

Python Rotating File Handler Logging Error #377

Isildur981 opened this issue Aug 8, 2024 · 1 comment
Labels
wontfix This will not be worked on

Comments

@Isildur981
Copy link

Granian ver 1.5.2
Python ver 3.12.4
OS: Windows 10 Enterprise - build 19045

When I configure granian to use the Python logging RotatingFileHandler, I get an error when the first file reaches the defined maximum file size. The file is not able to be closed and renamed with the .1 file extension.

This is the error that is displayed in the console:

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Logs\Starlette\access.log' -> 'C:\Logs\Starlette\access.log.1'

I have debugging in Starlette disabled, reload in granian is turned off, and the log level is set to info. I am only using one worker, since I'm running on Windows.

The RotatingFileHandler will work with uvicorn if I limit it to a single worker process, but I run into the same error if I use multiple workers with uvicorn. I don't know if this is pointing at the separate granian and Python processes being related to the problem, or if I have something else misconfigured. I can post my logging configuration JSON file if needed. Thanks ahead of time for any suggestions.

@gi0baro
Copy link
Member

gi0baro commented Aug 12, 2024

Given the issue is happening also with other libraries/configurations, I honestly doubt there's anything Granian can do for this.

Seems a good issue to open to CPython about the logging stdlib module.

@gi0baro gi0baro added the wontfix This will not be worked on label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants