File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Different level of log for different section in application

 
Rob Chung
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The application I work with has its own logging system which is very similar to Log4J. I have been asked to see if I can add function to the logging system so that logging not only varies in levels (debug, warning, error etc) but also in different application section. i.e. I can then have debug mode for section1, warning mode for section2 etc.
I am thinking of having a hashtable or something similar to hold the section indicator with its only logging switch.
Is there a better idea? Or is there any product thats already doing this I can download?
Also, is it advisable to switch to Log4J since its more of a standard?
Thanks in advance!
 
Rob Chung
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone has any idea please?
Thanks!
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have packaged your application to support it, you can do this in Log4J.
eg
set com.domain.application.database and everything under it to INFO
set com.domain.application.business and everything under it to WARN
set com.domain.application.presentation and everything under it to ERROR
As long as the code for these section are contained under the package, you've accomplished your goal.
Dave
 
Christopher Farnham
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where I'm working, they asked me to do some maintenance work on the in-house logging framework. I kept only the API from the legacy logging framework, turning it into a Log4J wrapper.
We gained a lot of functionality v quickly by doing that.
So I recommend replacing what you currently have with Log4J.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic