• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can logging using FileHandler be a bottleneck?

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This forum is dedicated to the SCJD certification. Please post in a more appropriate forum in future.
 
Alexander Bunkenburg
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic