logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m-%d %H:%M',
- filename='/temp/myapp.log',
+ filename='/tmp/myapp.log',
filemode='w')
# define a Handler which writes INFO messages or higher to the sys.stderr
console = logging.StreamHandler()
This example uses console and file handlers, but you can use any number and
combination of handlers you choose.
+Note that the above choice of log filename ``/tmp/myapp.log`` implies use of a
+standard location for temporary files on POSIX systems. On Windows, you may need to
+choose a different directory name for the log - just ensure that the directory exists
+and that you have the permissions to create and update files in it.
+
Configuration server example
----------------------------
have the task tracking API, which means that you can use
:class:`~queue.SimpleQueue` instances for *queue*.
+ .. note:: If you are using :mod:`multiprocessing`, you should avoid using
+ :class:`~queue.SimpleQueue` and instead use :class:`multiprocessing.Queue`.
.. method:: emit(record)
task tracking API (though it's used if available), which means that you can
use :class:`~queue.SimpleQueue` instances for *queue*.
+ .. note:: If you are using :mod:`multiprocessing`, you should avoid using
+ :class:`~queue.SimpleQueue` and instead use :class:`multiprocessing.Queue`.
+
If ``respect_handler_level`` is ``True``, a handler's level is respected
(compared with the level for the message) when deciding whether to pass
messages to that handler; otherwise, the behaviour is as in previous Python