Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #7961

Re: Improper creating of logger instances or a Memory Leak?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'doing,': 0.16; 'from:addr:vinay_sajip': 0.16; 'logger.': 0.16; 'message- id:@post.gmane.org': 0.16; 'sajip': 0.16; 'subject:creating': 0.16; 'thread.': 0.16; 'vinay': 0.16; 'writes:': 0.19; 'memory': 0.22; 'module,': 0.23; 'subject:?': 0.29; 'threads': 0.30; "can't": 0.32; 'represents': 0.32; 'header:X-Complaints-To:1': 0.32; 'to:addr:python-list': 0.33; "i've": 0.33; 'chris': 0.34; 'header:User-Agent:1': 0.35; 'module.': 0.35; 'using': 0.35; 'determine': 0.36; 'idea': 0.36; 'charset:us-ascii': 0.36; 'log': 0.36; 'running': 0.37; 'issue': 0.37; 'url:docs': 0.37; 'url:python': 0.38; 'received:org': 0.38; 'url:org': 0.38; 'run': 0.38; 'subject:: ': 0.38; 'some': 0.38; 'perhaps': 0.39; 'from:addr:yahoo.co.uk': 0.39; 'header:Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; 'your': 0.60; 'here:': 0.62; 'leak': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Vinay Sajip <vinay_sajip@yahoo.co.uk>
Subject Re: Improper creating of logger instances or a Memory Leak?
Date Sun, 19 Jun 2011 14:29:53 +0000 (UTC)
References <ebafe7b6-aa93-4847-81d6-12d396a4ff3c@j28g2000vbp.googlegroups.com>
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 82.152.15.113 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.150.1308493805.1164.python-list@python.org> (permalink)
Lines 17
NNTP-Posting-Host 82.94.164.166
X-Trace 1308493805 news.xs4all.nl 49180 [::ffff:82.94.164.166]:38595
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:7961

Show key headers only | View raw


foobar <wjshipman <at> gmail.com> writes:

> I've run across a memory leak in a long running process which I can't
> determine if its my issue or if its the logger.

As Chris Torek said, it's not a good idea to create a logger for each thread. A
logger name represents a place in your application; typically, a module, or
perhaps some part of a module. If you want to include information in the log to
see what different threads are doing, do that using the information provided
here:

http://docs.python.org/howto/logging-cookbook.html#adding-contextual-information-to-your-logging-output

Regards,

Vinay Sajip

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Improper creating of logger instances or a Memory Leak? foobar <wjshipman@gmail.com> - 2011-06-18 13:02 -0700
  Re: Improper creating of logger instances or a Memory Leak? Chris Torek <nospam@torek.net> - 2011-06-18 22:28 +0000
  Re: Improper creating of logger instances or a Memory Leak? Vinay Sajip <vinay_sajip@yahoo.co.uk> - 2011-06-19 14:29 +0000
  Re: Improper creating of logger instances or a Memory Leak? Vinay Sajip <vinay_sajip@yahoo.co.uk> - 2011-06-19 14:42 +0000
    Re: Improper creating of logger instances or a Memory Leak? foobar <wjshipman@gmail.com> - 2011-06-20 07:50 -0700
      Re: Improper creating of logger instances or a Memory Leak? Vinay Sajip <vinay_sajip@yahoo.co.uk> - 2011-06-20 17:19 -0700

csiph-web