Concurrency and performance degradation

2003-11-21 Thread Campos Rui Oliveira
Hi, everyone.

I'm stress testing a J2EE application and in certain executions (it is not happening 
always for the same conditions, maybe in 10% of the cases), i have got terrible times 
for a test case, and when i go and analyze where the most of the time is consumed, i 
realized that there is at Log4j in Category.info() statements.

Our logging strategy is to have a static Logger variable in each class that we want to 
have logging enabled with the fully qualified class name as the name of the logger. We 
are using DailyRollingFileAppender and ConsoleAppender to log into a file and into the 
console output.

There is anyway to improve the performance in a concurrency environment (maybe 
defining a buffer size and have only one thread writing to the file and to the 
console? ) and prevent this concurrency problems?
If, instead of having the logger for each class as a static variable, if i have a 
Logger instance for each instance of each class (as an instance variable), the 
performance is improved?

Regards,
 Rui Campos
 

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



RE: Concurrency and performance degradation

2003-11-21 Thread Campos Rui Oliveira
Hi.

Thanks for the reply.

What are the implications of using an AsyncAppender? With AsyncAppender don't i have 
an high probability of get a confused log with lines cutted at half by other lines 
that are being added?

Rui Campos

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: 21 November 2003 16:37
To: Log4J Users List
Subject: RE: Concurrency and performance degradation



Howdy,

There is anyway to improve the performance in a concurrency environment
(maybe defining a buffer size and have only one thread writing to the
file
and to the console? ) and prevent this concurrency problems?
If, instead of having the logger for each class as a static variable,
if i
have a Logger instance for each instance of each class (as an instance
variable), the performance is improved?

No, keep one instance per class.

Consider using the AsyncAppender or writing a buffered appender like the
SMTPAppender.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
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]