mach ich da was falsch?
Code: Alles auswählen
import logging
from logging.handlers import SysLogHandler, SYSLOG_UDP_PORT
LOG = logging.getLogger("Test")
def setup_logging():
'''Setup for the LOG object.'''
facility = SysLogHandler.LOG_MAIL
address = ('localhost', SYSLOG_UDP_PORT)
logHandler = SysLogHandler(address=address, facility=facility)
msgFormat = "%(name)s:%(levelname)s %(module)s:%(lineno)d: %(message)s"
fmt = logging.Formatter(msgFormat)
logHandler.setFormatter(fmt)
logging.root.addHandler(logHandler)
priority = SysLogHandler.LOG_INFO
logging.root.setLevel(priority)
setup_logging()
LOG.info(u"Hallö")
Code: Alles auswählen
Traceback (most recent call last):
File "logging/handlers.py", line 641, in emit
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 33: ordinal not in range(128)
Traceback (most recent call last):
File "logging/handlers.py", line 641, in emit
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 33: ordinal not in range(128)
Traceback (most recent call last):
File "logging/handlers.py", line 641, in emit
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 33: ordinal not in range(128)
Traceback (most recent call last):
File "logging/handlers.py", line 646, in emit
TypeError: sendto() takes exactly 3 arguments (2 given)
Gruß,
Manuel