File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) 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 » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Can logging using FileHandler be a bottleneck?" Watch "Can logging using FileHandler be a bottleneck?" New topic

Can logging using FileHandler be a bottleneck?

Alexander Bunkenburg

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?

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.
I agree. Here's the link:
subject: Can logging using FileHandler be a bottleneck?
It's not a secret anymore!