Re: [issue2551017] Error when configuring New -L (loghttpvialogger) option

"John P. Rouillard" <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
Hi Matt:

In message
<[email protected]>,
Matt writes:
>New submission from Matt:
>Hi I am receiving an error when I am attempting to configure the new
>logging with rotation.

Have you tried with logging.ini configured but no -L on the command
line?  I.E. same config as #1 and #2 below but no -L on the command
line.

>I have configured the settings as follows:
>
>1) Added entry to config.ini: config = logs\logging.ini
>2) Created the above file in my logs folder exactly as on the web page:
> [...]
>and am getting the following error on service startup. I am running on
>windows.
>
>The instance's SvcRun() method failed 
>Traceback (most recent call last):
>  File "C:\Python27\lib\site-packages\win32\lib\win32serviceutil.py",
>line 839, in SvcRun
>    self.SvcDoRun()
>  File
> [...]
>  File "C:\Python27\lib\site-packages\roundup\configuration.py", line
>1609, in init_logging
>    logging.config.fileConfig(_file)
>  File "C:\Python27\lib\logging\config.py", line 86, in fileConfig
>    _install_loggers(cp, handlers, disable_existing_loggers)
>  File "C:\Python27\lib\logging\config.py", line 190, in _install_loggers
>    llist.remove("root")
>ValueError: list.remove(x): x not in list 
>%2: %3
>
>If i comment out the line in the config.ini config = logs\logging.ini
>then the service starts successfully.

If it works without -L but with logging.ini configured, let me know
bwcuse what I suggest below is unlikley to work.

If it fails without -L, use the example below as your logging.ini.

====
[loggers]
keys=root,roundup,roundup.http

[logger_root]
#DEBUG, INFO, WARNING, ERROR, CRITICAL
#also for root only NOTSET (all)
level=DEBUG
handlers=basic

[logger_roundup]
#DEBUG, INFO, WARNING, ERROR, CRITICAL
#also for root only NOTSET (all)
level=DEBUG
handlers=basic
qualname=roundup
propagate=0

[logger_roundup.http]
level=INFO
handlers=rotate_weblog
qualname=roundup.http
propagate=0

[handlers]
keys=basic,rotate_weblog

[handler_rotate_weblog]
class=logging.handlers.RotatingFileHandler
args=('httpd.log','a', 512000, 2)
formatter=plain

[handler_basic]
class=StreamHandler
args=(sys.stderr,)
formatter=plain

[formatters]
keys=plain

[formatter_plain]
format=%(message)s
====

(Note I am writing this from memory, so it may need a little work.)

This adds root and roundup logger. Since the traceback includes
'llist.remove("root")', supplying a root logger may fix it. Also since
you are using roundup.http I wonder if a roundup logger is required as
well to complete the heirarchy.

Try running roundup by hand from a cmd window (not as a service) and
see if it the modified logging.ini works. If it does, we probably need
to change the basic handler to log to a rotating file or something
rather than stderr.

Let me know how this works.

--
				-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.