We have activated logging in our applications and have defined 2 back-ups for the rotation.
We often get errors when running web2py shell scripts because I think that the the web2py web application and the web2py shell script are both trying to access the log file. It looks like it is trying to perform a rotation at the moment of the error.
Can anyone give me an idea on how we can resolve with this conflict without disabling rotation?
Here is the full output:
--- Logging error ---
Traceback (most recent call last):
File "D:\Python\Miniconda3\envs\web2py_XYZ\lib\logging\handlers.py", line 74, in emit
File "D:\Python\Miniconda3\envs\web2py_XYZ\lib\logging\handlers.py", line 177, in doRollover
File "D:\Python\Miniconda3\envs\web2py_XYZ\lib\logging\handlers.py", line 115, in rotate
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'D:\\Data\\XYZ\\applications\\MyApp\\private\\app.log' -> 'D:\\Data\\XYZ\\applications\\MyApp\\private\\app.log.1'
File "D:\Data\XYZ\web2py.py", line 58, in <module>
File "D:\Data\XYZ\gluon\widget.py", line 746, in start
run(options.shell, plain=options.plain, bpython=options.bpython,
File "D:\Data\XYZ\gluon\shell.py", line 280, in run
_env = env(a, c=c, f=f, import_models=import_models, extra_request=extra_request)
File "D:\Data\XYZ\gluon\shell.py", line 181, in env
File "D:\Data\XYZ\gluon\compileapp.py", line 563, in run_models_in
restricted(ccode, environment, layer=model)
File "D:\Data\XYZ\gluon\restricted.py", line 219, in restricted
File "applications\MyApp\models\b_console.py", line 153, in <module>
console.log(source='b_console.py', message=str(console), add_timestamp=True)
File "applications\MyApp\models\b_console.py", line 147, in log
Thanks in advance,