<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#330033" bgcolor="#ffffff">
On 12/8/2010 9:43 AM, Vinay Sajip wrote:
<blockquote cite="mid:loom.20101208T174838-504@post.gmane.org"
type="cite">
<pre wrap=""><offtopic>
As am off-topic example, Armin Ronacher kept on saying in various posts and
presentations that you couldn't use stdlib logging for web applications, that
there were fundamental problems with it. But when he actually sent me his
specific problem statement, I gave him a solution without spending too much time
on it (see
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://plumberjack.blogspot.com/2010/09/configuring-logging-for-web.html">http://plumberjack.blogspot.com/2010/09/configuring-logging-for-web.html</a> if you
care). I'm not trying to be obstructive, honestly.
</offtopic>
</pre>
</blockquote>
<br>
Since my application is also web server related, I was curious
enough to look at this blog posting to see if it would be a good
starter example that is missing from the manual. I don't think it
is, as it is somewhat complex, although it is multi-module, and even
multi-thread, so it might make a good example for other parts of the
documentation (but maybe they already have good examples; I've only
looked at the first 8%).<br>
<br>
In trying to understand it, I couldn't figure out why the WebApp
class needs to keep track of the threads that are running the that
web app. Why isn't it good enough for the thread to know the name
of the app? The filter copies the appName from the thread to the
record; the InjectingFilter.filter not replace<br>
<br>
<pre> <span class="n">record</span><span class="o">.</span><span class="n">appName</span> <span class="o">=</span> <span class="n">tlocal</span><span class="o">.</span><span class="n">appName</span>
<span class="n">tname</span> <span class="o">=</span> <span class="n">threading</span><span class="o">.</span><span class="n">currentThread</span><span class="p">()</span><span class="o">.</span><span class="n">getName</span><span class="p">()</span>
<span class="k">return</span> <span class="n">tname</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">app</span><span class="o">.</span><span class="n">threads</span>
by
        record.appName = tlocal.appName
        return appName == self.app.name
and get the same effect, without needing to mainting the self.threads "database"?
Or what am I missing?
Glenn
</pre>
<br>
</body>
</html>