• Home
  • Raw
  • Download

Lines Matching refs: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
727 to have all the processes log to a :class:`~handlers.SocketHandler`, and have a
743 .. currentmodule:: logging.handlers
758 import logging.handlers
779 h = logging.handlers.RotatingFileHandler('mptest.log', 'a', 300, 10)
818 h = logging.handlers.QueueHandler(queue) # Just the one handler needed
866 import logging.handlers
882 qh = logging.handlers.QueueHandler(q)
905 'handlers': {
932 'handlers': ['foofile']
937 'handlers': ['console', 'file', 'errors']
1002 file-based handlers directly in your web application. Instead, use a
1018 logging package provides a :class:`~handlers.RotatingFileHandler`::
1022 import logging.handlers
1031 handler = logging.handlers.RotatingFileHandler(
1243 then passed to the handlers for that logger (and its ancestors, up to and
1253 via a :class:`~handlers.SocketHandler`, or in JSON form via an
1254 :class:`~handlers.HTTPHandler`).
1313 .. _zeromq-handlers:
1361 def __init__(self, uri, /, *handlers, **kwargs):
1366 super().__init__(socket, *handlers, **kwargs)
1381 Module :mod:`logging.handlers`
1382 Useful handlers included with the logging module.
1413 'handlers': {
1431 'handlers':['null'],
1436 'handlers': ['mail_admins'],
1441 'handlers': ['console', 'mail_admins'],
1471 rh = logging.handlers.RotatingFileHandler(...)
1493 handlers specified in the configuration. Note that these configurations are
1502 import logging.handlers
1512 which then get dispatched, by the logging system, to the handlers
1538 listener = logging.handlers.QueueListener(q, MyHandler())
1591 'handlers': {
1598 'handlers': ['console'],
1610 'handlers': {
1612 'class': 'logging.handlers.QueueHandler',
1617 'handlers': ['queue'],
1622 # logging configuration is available to dispatch events to handlers however
1640 'handlers': {
1668 'handlers': ['foofile']
1672 'handlers': ['console', 'file', 'errors'],
1718 :class:`~logging.handlers.SysLogHandler` to insert a BOM into the message, but
1730 :class:`~logging.handlers.SysLogHandler` instance, with a format string
1838 .. _custom-handlers:
1842 Customizing handlers with :func:`dictConfig`
1845 There are times when you want to customize logging handlers in particular ways,
1849 handlers in the stdlib don't offer built-in support. You can customize handler
1870 'handlers': {
1887 'handlers': ['file'],
1913 'handlers': {
1930 'handlers': ['file'],
1974 :class:`~logging.FileHandler` - for example, one of the rotating file handlers,
2141 'handlers': {
2149 'handlers': ['console']
2178 handlers and formatters. See :ref:`logging-config-dict-userdef` for more
2180 configuration, and see the other cookbook recipe :ref:`custom-handlers` above.
2255 might cause other handlers to be kept waiting. Here is a short example showing
2308 :class:`logging.handlers.MemoryHandler`, which allows buffering of logged events
2333 from logging.handlers import MemoryHandler
2472 'handlers': {
2483 'handlers': ['console1', 'console2'],
3064 Adding handlers other than :class:`NullHandler` to a logger in a library
3067 Configuring logging by adding handlers, formatters and filters is the
3069 are maintaining a library, ensure that you don't add handlers to any of your