Is the answer to this so obvious that no one is responding because I
just don't get it?
-Jim
Jim Steil wrote:
> Can anyone point me to additional doc on logging that might help me
> resolve this issue? I've searched the TG docs as well as the list
> archive and cannot find anything more. I think what I'm trying to do is
> exactly the use case for the logging, but I can't figure out why mine
> isn't working.
>
> -Jim
>
> Jim Steil wrote:
>
>> Hi
>>
>> I'm trying to get my logger to send ERROR log messages to an email
>> address. Here is my logging setup:
>>
>> log.cfg
>> # LOGGING
>> # Logging is often deployment specific, but some handlers and
>> # formatters can be defined here.
>>
>> [logging]
>> [[formatters]]
>> [[[message_only]]]
>> format='*(message)s'
>>
>> [[[full_content]]]
>> format='*(asctime)s *(name)s *(levelname)s *(message)s'
>>
>> [[handlers]]
>> [[[debug_out]]]
>> class='StreamHandler'
>> level='DEBUG'
>> args='(sys.stdout,)'
>> formatter='full_content'
>>
>> [[[access_out]]]
>> class='StreamHandler'
>> level='INFO'
>> args='(sys.stdout,)'
>> formatter='message_only'
>>
>> [[[error_out]]]
>> class='StreamHandler'
>> level='ERROR'
>> args='(sys.stdout,)'
>>
>> dev.cfg - Running in development for now
>> # LOGGING
>> # Logging configuration generally follows the style of the standard
>> # Python logging module configuration. Note that when specifying
>> # log format messages, you need to use *() for formatting variables.
>> # Deployment independent log configuration is in motion/config/log.cfg
>> [logging]
>>
>> [[loggers]]
>> [[[motion]]]
>> level='DEBUG'
>> qualname='motion'
>> handlers=['debug_out','error_out']
>>
>> [[[allinfo]]]
>> level='INFO'
>> handlers=['debug_out']
>>
>> [[[access]]]
>> level='INFO'
>> qualname='turbogears.access'
>> handlers=['access_out']
>> propagate=0
>>
>> [[handlers]]
>> [[[error_out]]]
>> class='SMTPHandler'
>> level='ERROR'
>> args="('mail.xxx.com','[EMAIL PROTECTED]',['[EMAIL PROTECTED]'],'TG Error')"
>>
>> If I set my my allinfo or access logger to use the error_out handler, I
>> get all the messages via email. But, I can't get it to work for the
>> 'DEBUG' info. What I want to do is send my DEBUG logs to sys.stdout via
>> the StreamHandler and then send ERROR level logs to my email address. I
>> think I have stuff setup pretty much like described here:
>>
>> http://groups.google.com/group/turbogears/browse_thread/thread/bbd4833ef7b9132c
>>
>> But, it doesn't seem to work. Am I missing something in how to setup
>> these logs?
>>
>> -Jim
>>
>>
>>
>>
>>
>>
>>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---