Well that worked but I'm not happy about it.  I have the following:

from logging.handlers import SysLogHandler

...

            'syslog':{
                'level':'DEBUG',
                'class': 'logging.handlers.SysLogHandler',
                'formatter': 'verbose',
                'facility': SysLogHandler.LOG_LOCAL2,
            },

If I specify 'class' as SysLogHandler instead of
'logging.handlers.SysLogHandler' I get an error:

ValueError: Unable to configure handler 'syslog': class SysLogHandler
has no attribute 'split'

If I just import logging and use
logging.handlers.SysLogHandler.LOG_LOCAL2 I get another error:

AttributeError: 'module' object has no attribute 'handlers'

Very bizarre behaviour all around but I'm up and running.  Thanks for
everybody's help!

On Jun 3, 11:14 am, Piotr Zalewa <zal...@gmail.com> wrote:
> In Add-ons Builder I've got something like this in log_settings.py
>
> https://github.com/mozilla/FlightDeck/blob/master/log_settings.py
>
>      'handlers': {
>          'syslog': {
>              '()': logging.handlers.SysLogHandler,
>              'facility': logging.handlers.SysLogHandler.LOG_LOCAL7,
>              'formatter': 'prod',
>          },
>      }
>
> It depends on the commonware, but I guess it's nothing there regarding
> logging to the SysLoghttps://github.com/jsocol/commonware/
>
> Good luck
> zalun
>
> On 06/03/11 16:02, Rob wrote:
>
>
>
> > Thanks, but this doesn't help at all.  I have no problem getting the
> > RotatingFileHandler working, it is documented albeit poorly, but the
> > SysLogHandler isn't documented at all and doesn't work the same way.
>
> > The SysLogHandler actually has to connect to syslogd and log to a
> > syslog facility (eg. LOG_USER or LOG_LOCAL0).  How do I configure
> > those
> > options?
>
> > Rob.
>
> > On Jun 1, 12:41 pm, Shawn Milochik<sh...@milochik.com>  wrote:
> >> This should help out. It's for a file, not SysLogHandler, but the idea
> >> is the same.
>
> >> Just take any arguments you would normally pass to the handler if you
> >> were creating it programmatically and add them as keys to the dictionary:
>
> >>           'log_file': {
> >>               'level': 'DEBUG',
> >>               'class': 'logging.handlers.RotatingFileHandler',
> >>               'filename': '/tmp/myfilename.log',
> >>               'formatter': 'verbose',
> >>               'backupCount': 50,
> >>               'maxBytes': 2 ** 20,
> >>           },
>
> >> As demonstrated here, filename, backupCount, and maxBytes (used by the
> >> RotatingFileHandler but not in Django's default logging dict) were just
> >> added and given values. Do the same for SysLogHandler parameters and it
> >> should work.
>
> >> I had the same difficulty you were having in figuring this out; we
> >> should update the documentation to mention this. I'll open a ticket.
>
> >> Shawn

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to