Re: Logging inside filters...

Yves Lafon <[email protected]> Tue, 18 Mar 2003 22:54:22 +0100 (MET)
Newsgroups gmane.comp.web.jigsaw
Message-ID <[email protected]>
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 =3D (FramedResource) getTargetResource(=
);
            if (target !=3D null) {
                String msg =3D ("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 the=
n
use the usual method on it.
Thanks,

--=20
Yves Lafon - W3C
"Baroula que barouleras, au ti=E9u toujou t'entourneras."