Note that there are some security issues with pickle in some scenarios. If
these affect you, you can use an alternative serialization scheme by overriding
-the :meth:`~handlers.SocketHandler.makePickle` method and implementing your
+the :meth:`~SocketHandler.makePickle` method and implementing your
alternative there, as well as adapting the above script to use your alternative
serialization.
You may need to tweak the configuration files in the unlikely event that the
configured ports clash with something else in your test environment.
+.. currentmodule:: logging
+
.. _context-info:
Adding contextual information to your logging output
file and log to that. You may want to keep a certain number of these files, and
when that many files have been created, rotate the files so that the number of
files and the size of the files both remain bounded. For this usage pattern, the
-logging package provides a :class:`~handlers.RotatingFileHandler`::
+logging package provides a :class:`RotatingFileHandler`::
import glob
import logging
Obviously this example sets the log length much too small as an extreme
example. You would want to set *maxBytes* to an appropriate value.
+.. currentmodule:: logging
+
.. _format-styles:
Use of alternative formatting styles
overhead to all logging operations, and the technique should only be used when
the use of a :class:`Filter` does not provide the desired result.
+.. currentmodule:: logging.handlers
.. _zeromq-handlers:
:ref:`A more advanced logging tutorial <logging-advanced-tutorial>`
+.. currentmodule:: logging
+
An example dictionary-based configuration
-----------------------------------------
attributes. However, this pattern doesn't make sense in Python, where the
module (and not the class) is the unit of software decomposition.
-Adding handlers other than :class:`NullHandler` to a logger in a library
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Adding handlers other than :class:`~logging.NullHandler` to a logger in a library
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Configuring logging by adding handlers, formatters and filters is the
responsibility of the application developer, not the library developer. If you