When I run the following under Python 3.1:
I get the following error:
Traceback (most recent call last):
File "/usr/lib/python3.1/logging/handlers.py", line 780, in emit
self.socket.sen d(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 :)
Code:
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.sen d(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 :)