In a message dated 3/8/2004 12:01:47 AM Eastern Standard Time, [EMAIL PROTECTED] writes:
Date:    Sun, 7 Mar 2004 12:35:26 -0800
From:    Tom Jackson <[EMAIL PROTECTED]>
Subject: Re: ns_logctl expansion?

On Sun, 2004-03-07 at 11:06, Zoran Vasiljevic wrote:

> Oh, misunderstanding...

Zoran, no I think I understood. From what I understand, each request has
a current url, used by the filter/request proc code to handle requests.

Your suggestion is to add tcl channel support to ns_log, with a new
command to change this on the fly.

However, as your example proves, this requires editing all your files
where you want to debug. This is the same issue we have now, logging for
specific areas 1, gets mixed with everything else and 2 requires editing
your files.

AOLserver has a nice trie structure (generic, but used to store
registered procs and filters). The same structure could be used to
handle logging. A tcl api might look similar to the register_proc api:

set fd [open ...]
ns_register_logger debug /my/buggy/app/* $fd
ns_register_logger notice /* [open /tmp/server.log a+]

Maybe too much work for what you want?

tom jackson
 
 
 
Hi,
 
Mapping method/url's to specific log files seems like a smart idea.  One problem: Examples above map only the url -- a weakness (or strength depending on your perspective) is that the trie data structure (i.e,. Ns_UrlSpecificSet) requires method and url so you'd have to ns_register_logger GET, POST, etc.  And, there's no wildcard option for the method.  This is probably something to change/fix given the new methods which are showing up (PUT, DELETE, etc.)
 
Also, the ns_logctl command does have per-thread buffering capabilities -- you could wrap whatever you're doing with it, e.g., in ADP:
 
<%
ns_logctl hold; # begins buffering log messages in this thread alone
ns_adp_include myfile.adp
set msgs [ns_logctl peek];  # gets current buffered log messages
ns_logctl release;  # disables buffer, flushes results to log file
...send $msgs somewhere, perhaps over the network...
%>
 
 
Also, the server log fd is currently very carefully dup'ed to fd 1 & 2. This captures dumb modules or API code which might carelessly chatter to stderr or stdout.
 
-Jim
 

-- AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.

Reply via email to