I’m trying to extend PyErrorLog, and since I’m using XMLParser( recover=True ), I’m trying to change all of the reported Levels to WARNING and log XML Syntax errors via etree.use_global_python_log(XMLErrorLog(logger=logging.getLogger(__name__).getChild('XMLParser'))) When I try to add level_map as an instance variable in my classes __init__() method, I get an error message saying that it’s not a writable attribute. When I add a level_map as a class variable, it doesn’t complain, but it doesn’t appear to use it in the mapping. With this mapping, everything is still tagged as CRITICAL or ERROR. class XMLErrorLog(etree.PyErrorLog): level_map = { etree.ErrorLevels.WARNING : logging.WARNING, etree.ErrorLevels.ERROR : logging.WARNING, etree.ErrorLevels.FATAL : logging.WARNING } I have then tried to modify level of the _LogEntry passed to receive before calling log method, but that also does not appear to be possible. I’ve finally managed to get something to work by using: class LogEntry(object): level = 1 And in my XMLErrorLog class: def receive(self, log_entry ): logrepr = "[ %s:%d:%d:%s:%s:%s: %s ]" % ( '', log_entry.line, log_entry.column, "Warning", log_entry.domain_name, log_entry.type_name, log_entry.message) self.log( LogEntry(), logrepr ) But it seemed from the documentation that providing the level_map in my class should have been enough. Am I missing something, or is the documentation incorrect ? — Steve Majewski