Expand|Select|Wrap|Line Numbers
- import logging
- from logging.handlers import SysLogHandler
- logger = logging.getLogger('TestLogger')
- logger.setLevel(logging.DEBUG)
- handler = logging.handlers.SysLogHandler(address='/dev/log')
- logger.addHandler(handler)
- logger.debug("This is a test")
Traceback (most recent call last):
File "/usr/lib/python3.1/logging/handlers.py", line 780, in emit
self.socket.send(msg)
TypeError: must be bytes or buffer, not str
I must be doing something fundamentally wrong...which is not surprising, given that I'm a total Python newbie :)