W3C home > Mailing lists > Public > www-jigsaw@w3.org > March to April 2003

RE: Logging inside filters...

From: Laird, Brian <BLaird@perseco.com>
Date: Thu, 27 Mar 2003 09:40:04 -0600
Message-ID: <45A6279F82E4CA4BBDC0F4EFC7B6A2FE126C73@atlas.perseco.com>
To: "Yves Lafon" <ylafon@w3.org>
Cc: <www-jigsaw@w3.org>

Minor correction:

In the example below, target.getServer().getLogger() doesn't work because there is no getLogger method on ServerInterface, you need to cast it to the httpd class to get the actual instance of the logger.

Hope this helps,

-----Original Message-----
From: Yves Lafon [mailto:ylafon@w3.org]
Sent: Tuesday, March 18, 2003 3:54 PM
To: Laird, Brian
Cc: www-jigsaw@w3.org
Subject: Re: Logging inside filters...

On Mon, 17 Mar 2003, Laird, Brian wrote:

> What is the recommended way of logging within custom built filters (ex:
> error logging)?  Is there an easy way to get a hook to the current
> logger?

From LogFilter:

            FramedResource target = (FramedResource) getTargetResource();
            if (target != null) {
                String msg = ("IO error while writing to log file \""+
                              ex.getMessage() + "\".");
                target.getServer().errlog(this, msg);

You can get the Logger object with target.getServer().getLogger() and then
use the usual method on it.

Yves Lafon - W3C
"Baroula que barouleras, au tiéu toujou t'entourneras."
Received on Thursday, 27 March 2003 10:40:17 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:38 UTC