Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'handler': 0.04; 'messages.': 0.04; 'output': 0.04; '__name__': 0.07; 'correct.': 0.07; '"if': 0.09; 'logger': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'stdout': 0.09; 'clause.': 0.16; 'empty.': 0.16; 'message-id:@post.gmane.org': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:Logging': 0.16; 'working.': 0.17; 'addition,': 0.21; 'seems': 0.23; 'paul': 0.24; 'header:User-Agent:1': 0.26; 'looks': 0.26; 'setting': 0.26; 'header:X-Complaints-To:1': 0.28; 'actual': 0.28; 'catching': 0.29; 'writes:': 0.29; 'code': 0.31; 'file': 0.32; 'from:addr:yahoo.co.uk': 0.32; 'could': 0.32; 'print': 0.32; 'to:addr:python-list': 0.33; "can't": 0.34; 'done': 0.34; 'add': 0.36; 'received:org': 0.36; 'created': 0.36; 'but': 0.36; 'should': 0.36; 'charset:us-ascii': 0.36; 'being': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'most': 0.61; 'levels': 0.66; 'calls,': 0.84; 'florian': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Vinay Sajip Subject: Re: Logging handler: No output Date: Sun, 2 Sep 2012 17:02:11 +0000 (UTC) References: <3165391.mTzesgFQhr@horus> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 81.102.154.149 (Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1346605345 news.xs4all.nl 6880 [2001:888:2000:d::a6]:38612 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28277 Florian Lindner xgm.de> writes: > But neither the FileHandler nor the StreamHandler produce any actual output. > The file is being created but stays empty. If I use a print output in the > while loop it works, so output is catched and the applications stdout in > working. But why the logger proclog catching nothing? > Paul Rubin's answer looks correct. In addition, you should note that every call to start_process will add a new handler to the logger (I can't tell if the logger could be the same on multiple calls, but it seems likely) and that may produce multiple messages. The rule of thumb is: most code should get loggers and log to them, but adding handlers, setting levels etc. should be only done in one place (typically invoked from a "if __name__ == '__main__'" clause. Regards, Vinay Sajip