Raúl Carazo | 1 Aug 09:36 2002
Picon

New filter

    I'm using log4J 1.2.5 and I'm trying to create a filter for some information. But I have a question. 

    I'm using the LoggingEvent class, and I've seen a field inside (logger) that returns a Category object. 

    I think it's the Category that called the log, isn't it? But I can't take some information that I've set
inside the Logger object... 

    Any idea?

    Thank you very much...

-----------------------------------------------------------------
Raúl Carazo ( rcarazo <at> bilbomatica.es )
Bilbomática S.A.
Licenciado Poza 55 4 planta 
Tel. 94.427.63.08
Fax 94.427.15.47
48013 BILBAO
Wullschleger, Donat | 1 Aug 09:48 2002
Picon

RE: RollingFileAppender disk full handling

Colin,

I tried a similar thing with the DailyRollingFileAppender (or for test
purposes just with the FileAppender). My aim was to ask the user to replace
the media if it is full with a new one or choose another location for the
logfile. To detect an exception or another error condition, I did add a
custom errorhandler (as Kevin suggested). But I stumbled when I wanted to
close the logfile and open a new one afterwards - I just couldn't find a
solution as 'reset' and 'close' also close the logger (and not only the
file) and after calling these functions log4j issues errormessages on the
console...

If you get any further, I would appreciate to hearing from you. 

Donat

P.S. please find below a code fragment of how I added the custem
errorhandler (LogFileErrorHandler) to all FileAppenders.

// Add custom errorhandler to all FileAppenders
Enumeration eapp = LogManager.getRootLogger().getAllAppenders();

for (Enumeration e = eapp;e.hasMoreElements();) {
   Object obj = e.nextElement();
   if (obj instanceof FileAppender) {
       FileAppender fa = (FileAppender) obj;
       LogFileErrorHandler lfh = new LogFileErrorHandler();
       fa.setErrorHandler(lfh);
    }
}
(Continue reading)

Ceki Gülcü | 1 Aug 09:47 2002
Picon

Re: New filter

At 09:36 01.08.2002 +0200, you wrote:
>     I'm using log4J 1.2.5 and I'm trying to create a filter for some 
> information. But I have a question.
>
>     I'm using the LoggingEvent class, and I've seen a field inside 
> (logger) that returns a Category object.
>
>     I think it's the Category that called the log, isn't it? But I can't 
> take some information that I've set inside the Logger object...

You are using a derived Logger class?

>     Any idea?
>-----------------------------------------------------------------
>Raúl Carazo ( rcarazo <at> bilbomatica.es )

--
Ceki
Raúl Carazo | 1 Aug 11:06 2002
Picon

New filter

    I can't receive to my mail, but I can see the messages in mail-archives.com, so...

    Yes, I've created an extension of Logger with a protected field. Then, in the decide method of my filter, I
want to see this field for testing its value, but it seem it doesn't work... I think I'm doing somethig wrong...!

    TIA

-----------------------------------------------------------------
Raúl Carazo ( rcarazo <at> bilbomatica.es )
Bilbomática S.A.
Licenciado Poza 55 4 planta 
Tel. 94.427.63.08
Fax 94.427.15.47
48013 BILBAO
Raúl Carazo | 1 Aug 11:14 2002
Picon

Fw: New filter


----- Original Message -----
From: "Raúl Carazo" <rcarazo <at> bilbomatica.es>
To: "Log4J" <log4j-dev <at> jakarta.apache.org>
Sent: Thursday, August 01, 2002 11:11 AM
Subject: Fw: New filter

    I can't receive to my mail, but I can see the messages in
mail-archives.com, so...

    Yes, I've created an extension of Logger with a protected field.
Then, in the decide method of my filter, I want to see this field for
testing its value, but it seem it doesn't work... I think I'm doing
somethig wrong...!

    TIA

-----------------------------------------------------------------
Raúl Carazo ( rcarazo <at> bilbomatica.es )
Bilbomática S.A.
Licenciado Poza 55 4 planta
Tel. 94.427.63.08
Fax 94.427.15.47
48013 BILBAO
Ceki Gülcü | 1 Aug 11:17 2002
Picon

Re: New filter


You should first subscribe to the log4j-user list. See
http://jakarta.apache.org/log4j/docs/contactUs.html for more
information.

At 11:06 01.08.2002 +0200, you wrote:
>     I can't receive to my mail, but I can see the messages in 
> mail-archives.com, so...
>
>     Yes, I've created an extension of Logger with a protected field. 
> Then, in the decide method of my filter, I want to see this field for 
> testing its value, but it seem it doesn't work... I think I'm doing 
> somethig wrong...!
>
>
>     TIA
>-----------------------------------------------------------------
>Raúl Carazo ( rcarazo <at> bilbomatica.es )

--
Ceki
Ceki Gülcü | 1 Aug 11:20 2002
Picon

Fwd: an AsyncAppender class


Paul,

If you omit the join operation, you have no way of knowing when the
appenders attached to the AsyncAppender have finished their work. If
thinking that the previous AsyncAppender was closed, you immediately
create another AsyncAppender that encapsulates appenders writing to
the same system resources (DB, file..) this may result in two sets of
appenders writing to the same file albeit for a short while. In the
case of databases this may result in out of order logs which is not a
big deal. However, in the case of files this may result in corrupt
files. It's a question of reliablity...

Hope this answers the question.

>Delivered-To: ceki <at> qos.ch
>X-Originating-IP: [139.149.1.195]
>From: "Paul Voutier" <pvoutier <at> hotmail.com>
>To: ceki <at> qos.ch
>Subject: an AsyncAppender class
>Date: Thu, 01 Aug 2002 08:57:28 +0000
>X-OriginalArrivalTime: 01 Aug 2002 08:57:29.0096 (UTC) 
>FILETIME=[76ED0880:01C23939]
>
>
>hi Ceki,
>
>I hope you don't mind me asking you another question.
>
>In the AsyncAppender.close() method, you call
(Continue reading)

Raúl Carazo | 1 Aug 11:21 2002
Picon

Re: New filter

>At 09:36 01.08.2002 +0200, you wrote:
>>     I'm using log4J 1.2.5 and I'm trying to create a filter for some 
>> information. But I have a question.
>>
>>     I'm using the LoggingEvent class, and I've seen a field inside 
>> (logger) that returns a Category object.
>>
>>     I think it's the Category that called the log, isn't it? But I can't 
>> take some information that I've set inside the Logger object...
>
>You are using a derived Logger class?
>
>>     Any idea?
>>-----------------------------------------------------------------
>>Raúl Carazo ( rcarazo <at> bilbomatica.es )
>
>--
>Ceki

Yes, I've created an extension of Logger with a protected field.
Then, in the decide method of my filter, I want to see this field for
testing its value, but it seem it doesn't work... I think I'm doing
somethig wrong...!

TIA

Ceki Gülcü | 1 Aug 11:30 2002
Picon

Re: New filter

At 11:21 01.08.2002 +0200, Raúl Carazo wrote:
> >At 09:36 01.08.2002 +0200, you wrote:
> >>     I'm using log4J 1.2.5 and I'm trying to create a filter for some
> >> information. But I have a question.
> >>
> >>     I'm using the LoggingEvent class, and I've seen a field inside
> >> (logger) that returns a Category object.
> >>
> >>     I think it's the Category that called the log, isn't it? But I can't
> >> take some information that I've set inside the Logger object...
> >
> >You are using a derived Logger class?
> >
> >>     Any idea?
> >>-----------------------------------------------------------------
> >>Raúl Carazo ( rcarazo <at> bilbomatica.es )
> >
> >--
> >Ceki
>
>Yes, I've created an extension of Logger with a protected field.
>Then, in the decide method of my filter, I want to see this field for
>testing its value, but it seem it doesn't work... I think I'm doing
>somethig wrong...!

Have you tried using the MDC instead?

>TIA

--
(Continue reading)

Raúl Carazo | 1 Aug 11:45 2002
Picon

Re: New filter


----- Original Message -----
From: "Ceki Gülcü" <ceki <at> qos.ch>
To: "Log4J Users List" <log4j-user <at> jakarta.apache.org>
Sent: Thursday, August 01, 2002 11:30 AM
Subject: Re: New filter

At 11:21 01.08.2002 +0200, Raúl Carazo wrote:
> >At 09:36 01.08.2002 +0200, you wrote:
> >>     I'm using log4J 1.2.5 and I'm trying to create a filter for some
> >> information. But I have a question.
> >>
> >>     I'm using the LoggingEvent class, and I've seen a field inside
> >> (logger) that returns a Category object.
> >>
> >>     I think it's the Category that called the log, isn't it? But I
can't
> >> take some information that I've set inside the Logger object...
> >
> >You are using a derived Logger class?
> >
> >>     Any idea?
> >>-----------------------------------------------------------------
> >>Raúl Carazo ( rcarazo <at> bilbomatica.es )
> >
> >--
> >Ceki
>
>Yes, I've created an extension of Logger with a protected field.
>Then, in the decide method of my filter, I want to see this field for
(Continue reading)


Gmane