Lines Matching full:handlers
37 # create formatter and add it to the handlers
41 # add the handlers to the logger
157 Multiple handlers and formatters
161 minimum or maximum quota for the number of handlers you may add. Sometimes it
164 this up, simply configure the appropriate handlers. The logging calls in the
178 # create formatter and add it to the handlers
182 # add the handlers to logger
193 Notice that the 'application' code does not care about multiple handlers. All
196 The ability to create new handlers with higher- or lower-severity filters can be
269 This example uses console and file handlers, but you can use any number and
270 combination of handlers you choose.
329 Dealing with handlers that block
332 .. currentmodule:: logging.handlers
334 Sometimes you have to get your logging handlers to do their work without
359 :class:`QueueListener` is very simple: it's passed a queue and some handlers,
363 handlers for processing.
413 import logging, logging.handlers
417 socketHandler = logging.handlers.SocketHandler('localhost',
418 logging.handlers.DEFAULT_TCP_LOGGING_PORT)
442 import logging.handlers
497 port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,
539 the :meth:`~handlers.SocketHandler.makePickle` method and implementing your
716 to have all the processes log to a :class:`~handlers.SocketHandler`, and have a
733 .. currentmodule:: logging.handlers
748 import logging.handlers
769 h = logging.handlers.RotatingFileHandler('mptest.log', 'a', 300, 10)
808 h = logging.handlers.QueueHandler(queue) # Just the one handler needed
856 import logging.handlers
872 qh = logging.handlers.QueueHandler(q)
895 'handlers': {
922 'handlers': ['foofile']
927 'handlers': ['console', 'file', 'errors']
962 logging package provides a :class:`~handlers.RotatingFileHandler`::
966 import logging.handlers
975 handler = logging.handlers.RotatingFileHandler(
1187 then passed to the handlers for that logger (and its ancestors, up to and
1197 via a :class:`~handlers.SocketHandler`, or in JSON form via an
1198 :class:`~handlers.HTTPHandler`).
1257 .. _zeromq-handlers:
1305 def __init__(self, uri, *handlers, **kwargs):
1310 super().__init__(socket, *handlers, **kwargs)
1325 Module :mod:`logging.handlers`
1326 Useful handlers included with the logging module.
1357 'handlers': {
1375 'handlers':['null'],
1380 'handlers': ['mail_admins'],
1385 'handlers': ['console', 'mail_admins'],
1415 rh = logging.handlers.RotatingFileHandler(...)
1437 handlers specified in the configuration. Note that these configurations are
1446 import logging.handlers
1456 which then get dispatched, by the logging system, to the handlers
1476 listener = logging.handlers.QueueListener(q, MyHandler())
1535 'handlers': {
1543 'handlers': ['console']
1554 'handlers': {
1556 'class': 'logging.handlers.QueueHandler',
1562 'handlers': ['queue']
1566 # logging configuration is available to dispatch events to handlers however
1584 'handlers': {
1612 'handlers': ['foofile']
1617 'handlers': ['console', 'file', 'errors']
1662 :class:`~logging.handlers.SysLogHandler` to insert a BOM into the message, but
1674 :class:`~logging.handlers.SysLogHandler` instance, with a format string
1782 .. _custom-handlers:
1786 Customizing handlers with :func:`dictConfig`
1789 There are times when you want to customize logging handlers in particular ways,
1793 handlers in the stdlib don't offer built-in support. You can customize handler
1814 'handlers': {
1831 'handlers': ['file'],
1857 'handlers': {
1874 'handlers': ['file'],
1918 :class:`~logging.FileHandler` - for example, one of the rotating file handlers,
2085 'handlers': {
2093 'handlers': ['console']
2122 handlers and formatters. See :ref:`logging-config-dict-userdef` for more
2124 configuration, and see the other cookbook recipe :ref:`custom-handlers` above.
2199 might cause other handlers to be kept waiting. Here is a short example showing
2252 :class:`logging.handlers.MemoryHandler`, which allows buffering of logged events
2277 from logging.handlers import MemoryHandler
2416 'handlers': {
2427 'handlers': ['console1', 'console2'],