Hi all,
I’m doing some local timing of some network code, and I’m using
WEBrick::HTTPProxyServer to mock out the actual network access to reduce
some of the variability.
What I’d like to do is stop the access logging from happening. That is,
I don’t want the access logs to fill up stdout or stderr, because
they’re used in my code and I want its output to stay clean. I also
don’t want the logs going to a string or array in memory, because it’ll
fill up and make everything swap endlessly. Ideally, I want the access
logging to just not happen, and I just can’t see how to do that.
Any ideas?
Could you redirect to a StringIO pointed at /dev/null? Without looking
at the WEBrick API, I wouldn’t know right off how to change the
destination of the logging messages. That’s the best I can help you
for now.
M.T.
Alex Y. wrote:
fill up and make everything swap endlessly. Ideally, I want the access
logging to just not happen, and I just can’t see how to do that.
Any ideas?
Ah. It would seem I should read a few more of the docs before posting.
Apparently doing this:
def access_log(*args); end
in the server class does the trick.
Not exactly intuitive, though…
Matt T. wrote:
Could you redirect to a StringIO pointed at /dev/null? Without looking
at the WEBrick API, I wouldn’t know right off how to change the
destination of the logging messages. That’s the best I can help you
for now.
M.T.
Thanks… I might try that next time. For now I’m overriding
HTTPProxyServer#access_log.
On 8/8/06, Alex Y. [email protected] wrote:
fill up and make everything swap endlessly. Ideally, I want the access
logging to just not happen, and I just can’t see how to do that.
Any ideas?
in your HTTPServer (or any descendant of GenericServer) write
logger.level = 0
you can do it from the outside as well.
your_server.logger.level = 0
For more details read the sources 
J.