• 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

Query on Logging

 
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Log files are like a heaven when any application goes live .

So is there any good solution available for logging.
At present what i do , when ever any method is invoked in a servlet or a java code , i'm logging a message like "Came into getCustInfo() with parameters .. ... ..." and some processed results, is there any better solution, that makes the application support maintenance easier.

Srini
 
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear srini

IO Operation are very costly for the performance of an application.

If you are using your own logger for your application then I will recomend to keep varios level of log.

try using log4j or java.util.logging API

If Still you want to carry on with ur logger implement the various level functionality.

earlier to log4j I used to use my own logger having 6 level like Info, Debug, Exception etc and there were respective method for same which can be enabled /disabled by flags in xml file.

hope this answer your query
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How many levels does java.util.logging API has ?
Srini
 
Ranch Hand
Posts: 126
Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Logging is essential for the application and the performance of the application too. Sometimes we have to do a lot of logging in our application to track down the exact problems. Log4J today is the most popular logger component used and is said to be one of the best as far as performance is concerned.

I am curious to know the reasons for log4j being performing better than any custom made component. What makes Log4J log messages faster than other components ?

Regards,


Nitin Dubey
 
Shailesh Chandra
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there are 7 levels in java.util.logging those are but i never used any

1. SEVERE
2. WARNING
3. INFO
4. CONFIG
5. FINE
6. FINER
7. FINEST

I am using log4j for my application.
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its true that Log files are Heaven, when an application goes to production. But the second part is, after some time in production, it should be taken care that these Log files dont become a HELL.

ya, IO operations are very costly which may directly degrade the performance of your application.

so use widely accepted tools like Log4j, which has different levels of logging and you can control which level should be logged, what should the threshold file size should be. What should be done when the file size reaches the threshold limit..etc

As thumb of rule, Dont try to re-invent the wheel.
 
If a regular clown is funny, then a larger clown would be funnier. Math. Verified by this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic