Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'handler': 0.04; 'subject:module': 0.04; 'attribute': 0.07; '__name__': 0.09; 'args,': 0.09; 'skip:l 60': 0.09; 'subject:python': 0.10; 'error:': 0.10; 'skip:" 40': 0.15; '"__main__":': 0.16; '%r"': 0.16; '**kwargs)': 0.16; '52,': 0.16; 'from:addr:tyler': 0.16; 'from:addr:tysdomain.com': 0.16; 'from:name:littlefield, tyler': 0.16; 'getting.': 0.16; 'light-weight': 0.16; 'message- id:@tysdomain.com': 0.16; 'msg,': 0.16; 'received:69.164': 0.16; 'received:69.164.206': 0.16; 'received:69.164.206.65': 0.16; 'received:tds-solutions.net': 0.16; 'reply-to:addr:tyler': 0.16; 'reply-to:addr:tysdomain.com': 0.16; 'self)': 0.16; 'subject:logging': 0.16; 'subject:question': 0.17; 'input': 0.22; 'all:': 0.23; 'works.': 0.23; "i'm": 0.26; 'skip:[ 10': 0.27; 'url:code': 0.28; 'error': 0.29; 'server': 0.30; 'skip:% 10': 0.30; '---': 0.31; 'header:User-Agent:1': 0.33; 'object': 0.33; 'on,': 0.34; 'to:addr:python-list': 0.34; 'curious': 0.34; 'file': 0.36; 'received:192': 0.37; 'some': 0.38; 'received:192.168.0': 0.38; 'to:addr:python.org': 0.40; 'received:192.168': 0.40; 'url:net': 0.60; 'type': 0.61; 'url:p': 0.62; 'engine': 0.68; 'day': 0.69; 'header:Reply-To:1': 0.71; 'reply-to:no real name:2**0': 0.72; 'factory': 0.73; 'care,': 0.77; 'observer': 0.84; 'so:': 0.84; 'subject::': 0.87 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on wuff X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable version=3.3.1 Date: Mon, 26 Dec 2011 23:26:39 -0700 From: "Littlefield, Tyler" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.25) Gecko/20111213 Lightning/1.0b2 Thunderbird/3.1.17 MIME-Version: 1.0 To: python-list@python.org Subject: python logging module:a quick question Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: tyler@tysdomain.com List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 53 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1324967582 news.xs4all.nl 6851 [2001:888:2000:d::a6]:59467 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18013 Hello all: I have a basic server I am working on, and wanted some input with an error I'm getting. I am initializing the logger like so: if __name__ == "__main__": observer = log.PythonLoggingObserver() observer.start() logging.basicConfig(filename='logs/server.log', level=logging.DEBUG, format='%(asctime)s [%(levelname)s] %(module)s:%(funcname)s:%(lineno)d %(message)s') logger = logging.getLogger() logger.addHandler(logging.handlers.TimedRotatingFileHandler) ... I get the following error: File "/home/gserver/alpine/lib/python2.7/site-packages/twisted/internet/protoc ol.py", line 52, in doStart log.msg("Starting factory %r" % self) --- --- File "/home/gserver/alpine/lib/python2.7/site-packages/twisted/python/log.py", line 284, in msg self.observers[i](actualEventDict) File "/home/gserver/alpine/lib/python2.7/site-packages/twisted/python/log.py", line 532, in emit self.logger.log(level, text) File "/usr/local/lib/python2.7/logging/__init__.py", line 1195, in log self._log(level, msg, args, **kwargs) File "/usr/local/lib/python2.7/logging/__init__.py", line 1250, in _log self.handle(record) File "/usr/local/lib/python2.7/logging/__init__.py", line 1260, in handle self.callHandlers(record) File "/usr/local/lib/python2.7/logging/__init__.py", line 1299, in callHandler s if record.levelno >= hdlr.level: exceptions.AttributeError: type object 'TimedRotatingFileHandler' has no attribute 'level' I'm also curious how this rotating handler works. Will it just log to a file per day for a week, then start rotating those out with newer ones? Can I change the interval? -- Take care, Ty Web: http://tds-solutions.net The Aspen project: a light-weight barebones mud engine http://code.google.com/p/aspenmud Sent from my toaster.