aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Can logging using FileHandler be a bottleneck? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Can logging using FileHandler be a bottleneck?" Watch "Can logging using FileHandler be a bottleneck?" New topic
Author

Can logging using FileHandler be a bottleneck?

Alexander Bunkenburg
Greenhorn

Joined: Nov 02, 2006
Posts: 8
Hello people

I am considering logging business events in a J2EE web application by using Java logging and FileHandler. I am wondering whether that could cause a performance bottleneck, since many log records will be written to the one file. I am doing google searches, but it seems people are not hindered by FileHandler.

What are your experiences and opinions?

Is logging a busy web application to one file with java logging and FileHandler likely to become performance bottleneck?

Thanks
Lucy Hummel
Ranch Hand

Joined: Apr 07, 2005
Posts: 232
HJi Alexander,

You got nothing for free.

If you log, memory, processor time are used to do it and you gain information what goes on in your application. You have good choices to switch trace mode to debug the system.

If you do not log, memory, processor time are free, but you do not have any clue what went wrong in a failure case.

The log stuff is already some years old so you can imangine that a lot of people, desingers have spent a lot of time to improve performance on the code.


----------------------------------<br />| SCJP, SCWCD, SCBCD, SCEA, SCJD |<br />----------------------------------
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
This forum is dedicated to the SCJD certification. Please post in a more appropriate forum in future.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Alexander Bunkenburg
Greenhorn

Joined: Nov 02, 2006
Posts: 8
Thanks for your reply. I should be more specific. I'm not asking about the advantages and disadvantages of logging in general. I am askng about logging from many threads to a single file. It seems that writing to one file is a point that all the threads must synchronise on, and that it could slow them down. The application could lose scalability.

Have you had experience with that?

I have now found x4juli which seems to address writing to multiple files. I will try it out soon.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can logging using FileHandler be a bottleneck?
 
Similar Threads
java util logging problems
question regarding logging
Can logging using FileHandler be a bottleneck?
How to make each log entry start on a new line?
how to append and limit the size of log file using java.util.logging