Re: Log4J System alerts

2006-11-30 Thread Bender Heri
Here a example how to configure filters. Note: Filters are only available if 
you use xml configuration.















This appender has three filters attached. The first is a log4j built in filter 
(LevelRangeFilter), the thow others are self written filters, derived from 
org.apache.log4j.spi.Filter which filter LogEvents based on some values in MDC.
If a LogEvent reaches an appender, it is presented to the attached filters in 
the order they are configured. The Filter results in:
- ACCEPT  the LogEvent is accepted, no more further Filters are asked
- DENYthe Log Event is rejected, no more further Filters are asked
- NEUTRAL next filter in chain is asked

within a self written Filter you can implement any logic you want.

Heri

> -Original Message-
> From: garima015 [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 29, 2006 11:39 PM
> To: log4j-user@logging.apache.org
> 
> 
> 
> Can you please give me some more idea on how to create that 
> filter..and how
> this will be called
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Log4J System alerts

2006-11-30 Thread garima015

Thanks Heri for ur help..
one thing more i want to ask is is this configuration will be done in
Log4j.properties..if not then where i have to write all this.And is
TraceDenyFilter and XMLDenyFilter are self made filters or do i have two
build two classes extending these filters. In case so where i have to save
these filter classes.

ur help is really useful to me


Bender Heri wrote:
> 
> Here a example how to configure filters. Note: Filters are only available
> if you use xml configuration.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  class="ch.ergonomics.pms.common.supervision.TraceDenyFilter"/>
>  class="ch.ergonomics.pms.common.supervision.XMLDenyFilter"/>
> 
> 
> This appender has three filters attached. The first is a log4j built in
> filter (LevelRangeFilter), the thow others are self written filters,
> derived from org.apache.log4j.spi.Filter which filter LogEvents based on
> some values in MDC.
> If a LogEvent reaches an appender, it is presented to the attached filters
> in the order they are configured. The Filter results in:
> - ACCEPT  the LogEvent is accepted, no more further Filters are asked
> - DENYthe Log Event is rejected, no more further Filters are asked
> - NEUTRAL next filter in chain is asked
> 
> within a self written Filter you can implement any logic you want.
> 
> Heri
> 
>> -Original Message-
>> From: garima015 [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, November 29, 2006 11:39 PM
>> To: log4j-user@logging.apache.org
>> 
>> 
>> 
>> Can you please give me some more idea on how to create that 
>> filter..and how
>> this will be called
>> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Log4J-System-alerts-tf2727572.html#a7620430
Sent from the Log4j - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Log4J System alerts

2006-11-30 Thread Bender Heri
If you want to work with filters you must use log4j.xml configuration instead 
of log4j.properties. The properties configuration style does not support filter 
entries. It's anyway recommended to use xml configuration since:
- the auto configuration mechanisme of log4j looks first for the log4j.xml file
- the properties configuration style is no more supported in future releases
- In my opinion the xml is clearer and more self-documenting than properties

TraceDenyFilter and XMLDenyFilter are self made classes derived from the 
log4jFilter class (see previous mail). They serve only as example how you 
can configure your own filter. Note that you can also configure own member 
properties of your own filter if they have standard setter methods:

public void setMyProperty( String aValue)

will be configured as 

)

The storage location of your self made filter is like any other class: 
somewhere in the known classpath.

Heri

> -Original Message-
> From: garima015 [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 30, 2006 3:37 PM
> To: log4j-user@logging.apache.org
> Subject: Re: Log4J System alerts
> 
> 
> 
> Thanks Heri for ur help..
> one thing more i want to ask is is this configuration will be done in
> Log4j.properties..if not then where i have to write all this.And is
> TraceDenyFilter and XMLDenyFilter are self made filters or do 
> i have two
> build two classes extending these filters. In case so where i 
> have to save
> these filter classes.
> 
> ur help is really useful to me
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Log4J System alerts

2006-11-30 Thread garima015

Thanks Heri..thanks for ur help!!!
I hope log4j.xml will also be read in the same manner as log4j.properties..


Bender Heri wrote:
> 
> If you want to work with filters you must use log4j.xml configuration
> instead of log4j.properties. The properties configuration style does not
> support filter entries. It's anyway recommended to use xml configuration
> since:
> - the auto configuration mechanisme of log4j looks first for the log4j.xml
> file
> - the properties configuration style is no more supported in future
> releases
> - In my opinion the xml is clearer and more self-documenting than
> properties
> 
> TraceDenyFilter and XMLDenyFilter are self made classes derived from the
> log4jFilter class (see previous mail). They serve only as example how
> you can configure your own filter. Note that you can also configure own
> member properties of your own filter if they have standard setter methods:
> 
> public void setMyProperty( String aValue)
> 
> will be configured as 
> 
> )
> 
> The storage location of your self made filter is like any other class:
> somewhere in the known classpath.
> 
> Heri
> 
>> -Original Message-
>> From: garima015 [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, November 30, 2006 3:37 PM
>> To: log4j-user@logging.apache.org
>> Subject: Re: Log4J System alerts
>> 
>> 
>> 
>> Thanks Heri for ur help..
>> one thing more i want to ask is is this configuration will be done in
>> Log4j.properties..if not then where i have to write all this.And is
>> TraceDenyFilter and XMLDenyFilter are self made filters or do 
>> i have two
>> build two classes extending these filters. In case so where i 
>> have to save
>> these filter classes.
>> 
>> ur help is really useful to me
>> 
>> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Log4J-System-alerts-tf2727572.html#a7620776
Sent from the Log4j - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Log4J System alerts

2006-11-30 Thread garima015

Heri one more thing can we place log4j.xml in root directory of project as my
project is not a Web project so i wont be having web-inf in that!!!


garima015 wrote:
> 
> Thanks Heri..thanks for ur help!!!
> I hope log4j.xml will also be read in the same manner as
> log4j.properties..
> 
> 
> Bender Heri wrote:
>> 
>> If you want to work with filters you must use log4j.xml configuration
>> instead of log4j.properties. The properties configuration style does not
>> support filter entries. It's anyway recommended to use xml configuration
>> since:
>> - the auto configuration mechanisme of log4j looks first for the
>> log4j.xml file
>> - the properties configuration style is no more supported in future
>> releases
>> - In my opinion the xml is clearer and more self-documenting than
>> properties
>> 
>> TraceDenyFilter and XMLDenyFilter are self made classes derived from the
>> log4jFilter class (see previous mail). They serve only as example how
>> you can configure your own filter. Note that you can also configure own
>> member properties of your own filter if they have standard setter
>> methods:
>> 
>> public void setMyProperty( String aValue)
>> 
>> will be configured as 
>> 
>> )
>> 
>> The storage location of your self made filter is like any other class:
>> somewhere in the known classpath.
>> 
>> Heri
>> 
>>> -Original Message-
>>> From: garima015 [mailto:[EMAIL PROTECTED]
>>> Sent: Thursday, November 30, 2006 3:37 PM
>>> To: log4j-user@logging.apache.org
>>> Subject: Re: Log4J System alerts
>>> 
>>> 
>>> 
>>> Thanks Heri for ur help..
>>> one thing more i want to ask is is this configuration will be done in
>>> Log4j.properties..if not then where i have to write all this.And is
>>> TraceDenyFilter and XMLDenyFilter are self made filters or do 
>>> i have two
>>> build two classes extending these filters. In case so where i 
>>> have to save
>>> these filter classes.
>>> 
>>> ur help is really useful to me
>>> 
>>> 
>> 
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Log4J-System-alerts-tf2727572.html#a7620955
Sent from the Log4j - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Log4J System alerts

2006-11-30 Thread Bender Heri
For auto configuration log4j.xml must be found in the classpath. Else you can 
do it within code by calling DOMConfigurator.configure( 
myFullOrRelativeFileName ).
Heri

> -Original Message-
> From: garima015 [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 30, 2006 4:05 PM
> To: log4j-user@logging.apache.org
> Subject: RE: Log4J System alerts
> 
> 
> 
> Heri one more thing can we place log4j.xml in root directory 
> of project as my
> project is not a Web project so i wont be having web-inf in that!!!
> 
> 
> garima015 wrote:
> > 
> > Thanks Heri..thanks for ur help!!!
> > I hope log4j.xml will also be read in the same manner as
> > log4j.properties..
> > 
> > 
> > Bender Heri wrote:
> >> 
> >> If you want to work with filters you must use log4j.xml 
> configuration
> >> instead of log4j.properties. The properties configuration 
> style does not
> >> support filter entries. It's anyway recommended to use xml 
> configuration
> >> since:
> >> - the auto configuration mechanisme of log4j looks first for the
> >> log4j.xml file
> >> - the properties configuration style is no more supported in future
> >> releases
> >> - In my opinion the xml is clearer and more self-documenting than
> >> properties
> >> 
> >> TraceDenyFilter and XMLDenyFilter are self made classes 
> derived from the
> >> log4jFilter class (see previous mail). They serve only 
> as example how
> >> you can configure your own filter. Note that you can also 
> configure own
> >> member properties of your own filter if they have standard setter
> >> methods:
> >> 
> >> public void setMyProperty( String aValue)
> >> 
> >> will be configured as 
> >> 
> >> )
> >> 
> >> The storage location of your self made filter is like any 
> other class:
> >> somewhere in the known classpath.
> >> 
> >> Heri
> >> 
> >>> -Original Message-
> >>> From: garima015 [mailto:[EMAIL PROTECTED]
> >>> Sent: Thursday, November 30, 2006 3:37 PM
> >>> To: log4j-user@logging.apache.org
> >>> Subject: Re: Log4J System alerts
> >>> 
> >>> 
> >>> 
> >>> Thanks Heri for ur help..
> >>> one thing more i want to ask is is this configuration 
> will be done in
> >>> Log4j.properties..if not then where i have to write all 
> this.And is
> >>> TraceDenyFilter and XMLDenyFilter are self made filters or do 
> >>> i have two
> >>> build two classes extending these filters. In case so where i 
> >>> have to save
> >>> these filter classes.
> >>> 
> >>> ur help is really useful to me
> >>> 
> >>> 
> >> 
> >> 
> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >> 
> >> 
> >> 
> > 
> > 
> 
> -- 
> View this message in context: 
http://www.nabble.com/Log4J-System-alerts-tf2727572.html#a7620955
Sent from the Log4j - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Log4J System alerts

2006-11-30 Thread garima015

Thanks Heri i am able to read the xml file now.
Thanks for ur time.



Bender Heri wrote:
> 
> For auto configuration log4j.xml must be found in the classpath. Else you
> can do it within code by calling DOMConfigurator.configure(
> myFullOrRelativeFileName ).
> Heri
> 
>> -Original Message-
>> From: garima015 [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, November 30, 2006 4:05 PM
>> To: log4j-user@logging.apache.org
>> Subject: RE: Log4J System alerts
>> 
>> 
>> 
>> Heri one more thing can we place log4j.xml in root directory 
>> of project as my
>> project is not a Web project so i wont be having web-inf in that!!!
>> 
>> 
>> garima015 wrote:
>> > 
>> > Thanks Heri..thanks for ur help!!!
>> > I hope log4j.xml will also be read in the same manner as
>> > log4j.properties..
>> > 
>> > 
>> > Bender Heri wrote:
>> >> 
>> >> If you want to work with filters you must use log4j.xml 
>> configuration
>> >> instead of log4j.properties. The properties configuration 
>> style does not
>> >> support filter entries. It's anyway recommended to use xml 
>> configuration
>> >> since:
>> >> - the auto configuration mechanisme of log4j looks first for the
>> >> log4j.xml file
>> >> - the properties configuration style is no more supported in future
>> >> releases
>> >> - In my opinion the xml is clearer and more self-documenting than
>> >> properties
>> >> 
>> >> TraceDenyFilter and XMLDenyFilter are self made classes 
>> derived from the
>> >> log4jFilter class (see previous mail). They serve only 
>> as example how
>> >> you can configure your own filter. Note that you can also 
>> configure own
>> >> member properties of your own filter if they have standard setter
>> >> methods:
>> >> 
>> >> public void setMyProperty( String aValue)
>> >> 
>> >> will be configured as 
>> >> 
>> >> )
>> >> 
>> >> The storage location of your self made filter is like any 
>> other class:
>> >> somewhere in the known classpath.
>> >> 
>> >> Heri
>> >> 
>> >>> -Original Message-
>> >>> From: garima015 [mailto:[EMAIL PROTECTED]
>> >>> Sent: Thursday, November 30, 2006 3:37 PM
>> >>> To: log4j-user@logging.apache.org
>> >>> Subject: Re: Log4J System alerts
>> >>> 
>> >>> 
>> >>> 
>> >>> Thanks Heri for ur help..
>> >>> one thing more i want to ask is is this configuration 
>> will be done in
>> >>> Log4j.properties..if not then where i have to write all 
>> this.And is
>> >>> TraceDenyFilter and XMLDenyFilter are self made filters or do 
>> >>> i have two
>> >>> build two classes extending these filters. In case so where i 
>> >>> have to save
>> >>> these filter classes.
>> >>> 
>> >>> ur help is really useful to me
>> >>> 
>> >>> 
>> >> 
>> >> 
>> -
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >> 
>> >> 
>> >> 
>> > 
>> > 
>> 
>> -- 
>> View this message in context: 
> http://www.nabble.com/Log4J-System-alerts-tf2727572.html#a7620955
> Sent from the Log4j - Users mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Log4J-System-alerts-tf2727572.html#a7621426
Sent from the Log4j - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: log4j for python and chainsaw possible?

2006-11-30 Thread Scott Deboy
You can have Chainsaw process events generated in Python...there are two
commonly-used mechanisms:
 - Write an XMLSocketAppender that sends logging events to a socket,
conforming to logging events in log4j's dtd and configure Chainsaw to
use an XMLSocketReceiver

 - Write events to a log file and configure Chainsaw to use a
LogFilePatternReceiver (or VFSLogFilePatternReceiver if accessing log
files available over ssh)

There are other network-based options as well (UDP, multicast), but they
can lose events and require UDP/multicast in your network between the
Chainsaw and appender.

 
Scott Deboy
Principal Engineer
COMOTIV SYSTEMS
111 SW Columbia Street Ste. 950
Portland, OR  97201
Telephone: 503.224.7496
Cell: 503.997.1367
Fax: 503.222.0185
[EMAIL PROTECTED]
www.comotivsystems.com


-Original Message-
From: Lucie Chan [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 29, 2006 11:29 PM
To: log4j-user@logging.apache.org
Subject: log4j for python and chainsaw possible?

Hi,

I have a library that allows various components written in different
programming languages (perl, python, java) to talk to each other, and
I'd
like to capture the different log messages from each component and
display
them in a centralized GUI application.  I wonder if the following is
possible:

Each component logs its event messages using log4j and directs the
messages
to a socket using the SocketAppender.  The idea is the I can then use
chainsaw to read the messages from the socket and display them in the
GUI.
So far, I have no problem in getting Java to work with log4j and
chainsaw,
and it seems to work for Perl as well (according its FAQ), but the
questions
I have is Python.  I've founded very little information on this.

Does anyone have an suggestion?  Thanks!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: File Appender in log4j

2006-11-30 Thread Curt Arnold


On Nov 29, 2006, at 10:11 PM, ying lcs wrote:


I try it, but I get this error "

log4j:WARN No such property [maxBackupIndex] in
org.apache.log4j.DailyRollingFileAppender.

I put this line in the log4j properties file.
log4j.appender.ACCESS.MaxBackupIndex=7


On 11/28/06, Shuh Chang <[EMAIL PROTECTED]> wrote:

I think you can set the MaxBackupIndex parameter like this:

log4j.appender.drfa.MaxBackupIndex=7


That parameter only exists for RollingFileAppender.  To the best of  
my knowledge there isn't a way to do that in log4j, but since the  
files should be closed, you are free to have a cron job to do that  
maintenance.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]