Can someone help me with my logging configuration? I have read the logging
and pyramid_exclog documentation and come up with a configuration that I
think should send errors to both a file handler and an SMTP handler, but
when an error occurs it is not in the file or emailed -- the error does
show up in the stdout (or stderr, they redirect to the same file) though. I
am using Paste server (not in daemon mode) with supervisord and Pyramid
1.2. I have absolutely no idea what I have done wrong in this configuration:
[loggers]
keys = root, buildings, sqlalchemy, access_log, exc_logger
[handlers]
keys = console, file, exc_handler
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = file
[logger_buildings]
level = INFO
handlers =
qualname = myapp.buildings
[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither. (Recommended for production systems.)
[logger_access_log]
level = INFO
handlers =
qualname = access_log
[logger_exc_logger]
level = ERROR
handlers = exc_handler
qualname = exc_logger
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[handler_file]
class = logging.handlers.RotatingFileHandler
args = ('/var/log/production.log', 'a', 1048576, 25)
level = INFO
formatter = generic
[handler_exc_handler]
class = handlers.SMTPHandler
args = (('smtp.example.com', 25), '[email protected]',
['[email protected]'], '[Error]')
level = ERROR
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s]
%(message)s
datefmt = %Y-%m-%d %H:%M:%S
I have also tried setting handlers under logger_exc_logger to "exc_handler,
file" in case it wasn't propagating by default, but that did not change
anything.
Thanks for the help,
Jason
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/pylons-discuss/-/2wIBlPOCoucJ.
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/pylons-discuss?hl=en.