Thanks for the quick reply!

It says on the page:

This handler is not appropriate for use under Windows, because under Windows 
open log files cannot be moved or renamed - logging opens the files with 
exclusive locks - and so there is no need for such a handler. Furthermore, 
*ST_INO* is not supported under Windows; stat() 
<https://docs.python.org/3/library/os.html#os.stat> always returns zero for 
this value.



On Friday, January 25, 2019 at 3:55:22 PM UTC-5, Mikko Ohtamaa wrote:
>
> Hi Marcus,
>
>
> Hello!
>> I am trying to setup logging. I have run into a bug. If I 
>> use RotatingFileHandler and try to start my pyramid setup with pserve 
>> --reload development.ini, it throws an error similar to this when it tries 
>> to rotate the file:
>>
>
> Maybe this 
> https://docs.python.org/3/library/logging.handlers.html#watchedfilehandler
>
>  
>
>>
>> PermissionError: [WinError 32] The process cannot access the file 
>> because it is being used by another process: 'C:\\var\\log\\testing.log' 
>> -> 'C:\\var\\log\\testing.log.1'
>>
>> Here is the logging portion of my development.ini:
>>
>> [loggers]
>> keys = root, companalysis
>>
>> [handlers]
>> keys = console, filelog, debugfilelog
>>
>> [formatters]
>> keys = generic
>>
>> [logger_root]
>> level = DEBUG
>> handlers = console, debugfilelog
>>
>> [logger_companalysis]
>> level = DEBUG
>> handlers = filelog
>> qualname = companalysis
>>
>> [handler_console]
>> class = StreamHandler
>> args = (sys.stderr,)
>> level = INFO
>> formatter = generic
>>
>> [handler_filelog]
>> class=handlers.RotatingFileHandler
>> level=DEBUG
>> args=('/var/log/testing.log','a',1000,100)
>> formatter=generic
>>
>> [handler_debugfilelog]
>> class=handlers.RotatingFileHandler
>> level=NOTSET
>> args=('/var/log/toolbox_debugging.log','a',1000,100)
>> formatter=generic
>>
>> [formatter_generic]
>> format = %(asctime)s %(levelname)-5.5s 
>> [%(name)s:%(lineno)s][%(threadName)s] %(message)s
>>
>> I am on Windows 10.
>>
>> If I start it without the --reload tag, it works as expected.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "pylons-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/pylons-discuss/098b16e7-1955-4d21-9f4c-6a32d82fe103%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/pylons-discuss/098b16e7-1955-4d21-9f4c-6a32d82fe103%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/978cfa63-f5aa-48c2-86d6-3e04cb9445b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to