RE: [SPAM (Bayesain Analysis)] - Can i instentiate the log4j logger object? - Bayesian Filter detected spam

2007-10-22 Thread Bender Heri
Hallo Michael
 
About a year ago it was discussed to have a MultiFileAppender which can cover 
exactly this problem. The idea did not get over a sandbox project and is now 
sleeping. 
 
Using current version of log4j it is possible if you write your own repository 
selector. The default repository is also a singleton, but your self written 
selector can instantiate a repository for each thread. On each thread start you 
will then configure your appender(s) by code.
 
Look at the archive, this was discussed a lot (a year or two ago).
 
Heri
 
 

-Original Message-
From: Michael [mailto:[EMAIL PROTECTED]
Sent: Friday, October 19, 2007 11:13 AM
To: log4j-user@logging.apache.org
Subject: [SPAM (Bayesain Analysis)] - Can i instentiate the log4j logger 
object? - Bayesian Filter detected spam



Dear sir,

 

Recently I was try with the log4j to use it to record my system out messages, 
however it seems that when I want to have 2 thread within the same JVM where 
each of them having their own log files is not possible. Because the Logger 
object is singleton. 

 

Is there any way that I can have init 2 different instance of Logger (with 
different configuration of file to be write to) on each thread and each their 
own log files ??

 

 

Thanks,

 

 


 


Logo-sig-(tecforte)

Sincerely,  

Michael Liong

Software Engineer

TecForte Sdn Bhd

‘Smart Security Management’ 

Parcel No 2A-13-2, Plaza Sentral - Phase II,
Jalan Stesen Sentral 5, Kuala Lumpur Sentral,
50470 Kuala Lumpur, Malaysia
Tel: +6(03) 2264 3164 

Fax: +6(03) 2264 3064

 

 http://www.tecforte.com/ http://www.tecforte.com

 


 

 

 


==


 

 

 


This e-mail and any files transmitted with it are confidential, legally 
privileged and are for the sole use of the intended recipient. If you are not 
the intended recipient of this e-mail or any part of it, you are not to 
reproduce or distribute it. Please notify the sender by return e-mail and 
discard the contents.  In circumstances where the contents of this e-mail may 
have legal significance, you should not place any reliance on its contents 
without following up in writing. 

 

 

 


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.488 / Virus Database: 269.15.1/1078 - Release Date: 10/18/2007 
5:47 PM






Re: Can i instentiate the log4j logger object?

2007-10-22 Thread Curt Arnold


On Oct 19, 2007, at 4:12 AM, Michael wrote:


Dear sir,

Recently I was try with the log4j to use it to record my system out  
messages, however it seems that when I want to have 2 thread within  
the same JVM where each of them having their own log files is not  
possible. Because the Logger object is singleton.
Is there any way that I can have init 2 different instance of  
Logger (with different configuration of file to be write to) on  
each thread and each their own log files ??


Thanks,




Logger is not singleton, there can be many instances of Logger.   
However, only one logger in a hierarchy can gave a particular name.   
Having multiple hierarchies (which would allow you to have multiple  
instances of Logger with the same name) would require that you pass  
the Logger or LoggerRepository as a parameter to all your methods or  
use some other mechanism to access the appropriate repository for  
your thread.   A better approach is to have a single appender that  
writes to multiple files depending on the thread making the logging  
request.


There was a discussion on 16-Oct-2007 on log4j-user of an appender  
that used thread local storage to accomplish that.  Also, there was a  
experimental effort to develop a MultifileAppender where file-per- 
thread was one of several use-cases, but that effort languished  
because of competing demands on my time and no others pitching in.   
As mentioned in the recent thread on log4j-user, the topic has come  
up repeatedly recently and I'd like to finish off the  
MultifileAppender effort and put it into extras.



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



Re: Question: Chainsaw usage

2007-10-22 Thread Paul Smith


On 20/10/2007, at 7:51 PM, Owe Andresen wrote:


Hello,
(@first, im new to this list).

1. I write a sutom receiver for our log-message formats. What  
bothers me is that i have to open the recevers configuration file  
each time when i start Chainsaw.




Why don't you configure the URL of the config file in the  
preferences?  Then it will be loaded each time automatically?


2. I restart Chainsaw alot, becase i cannot remove the visible  
receivers once they are in the treeview of the chainsaw lgomessage  
panel.



I don't understand what you mean here.

3. I got concurrent modification exception, when having alot of  
messages (15).. Also i got IllegalArgumentException when  
filtering by date (with only 7000 logmessages also). known?


A stacktrace to this mailing list would be useful here, otherwise we  
don't know what problem you are encountering.


4. I am missing that jump-to-logmessage by number, i heard it was  
announced somewhere. When will this feature come in a new Chainsaw  
release?


This is in the trunk version of Chainsaw, not yet released (waiting  
on some downstream log4j modules to be released first).


cheers,

Paul

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



Re: Question: Chainsaw usage

2007-10-22 Thread stevenmmatic
All,

I have been lurking for a short while and I have to say, good job!

Your response times are fantastic!

Steve
Sent from my BlackBerry device on the Rogers Wireless Network

-Original Message-
From: Paul Smith [EMAIL PROTECTED]

Date: Tue, 23 Oct 2007 10:20:14 
To:Log4J Users List log4j-user@logging.apache.org
Subject: Re: Question: Chainsaw usage



On 20/10/2007, at 7:51 PM, Owe Andresen wrote:

 Hello,
 (@first, im new to this list).

 1. I write a sutom receiver for our log-message formats. What  
 bothers me is that i have to open the recevers configuration file  
 each time when i start Chainsaw.


Why don't you configure the URL of the config file in the  
preferences?  Then it will be loaded each time automatically?

 2. I restart Chainsaw alot, becase i cannot remove the visible  
 receivers once they are in the treeview of the chainsaw lgomessage  
 panel.

I don't understand what you mean here.

 3. I got concurrent modification exception, when having alot of  
 messages (15).. Also i got IllegalArgumentException when  
 filtering by date (with only 7000 logmessages also). known?

A stacktrace to this mailing list would be useful here, otherwise we  
don't know what problem you are encountering.

 4. I am missing that jump-to-logmessage by number, i heard it was  
 announced somewhere. When will this feature come in a new Chainsaw  
 release?

This is in the trunk version of Chainsaw, not yet released (waiting  
on some downstream log4j modules to be released first).

cheers,

Paul

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