Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there a way to handle logging of exceptions.

 
ram kumar
Ranch Hand
Posts: 146
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for instance,

i have 5 java classes all these has try catch block in it.

when an exception happens ... that exception has to be logged in the logs.

BUT WE WILL NOT PUT EVEN A SINGLE LINE OF CODE IN THE 5 CLASSES.

SOME OTHER CLASS SAY, CLASS 6 HAS TO DO THIS MONITORING ALL OTHER 5 CLASSES FOR EXCEPTIONS.

IS THIS POSSIBLE / OR IS THERE ANY OTHER WAY TO DO THAT.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Ram ranch",
Please check your private messages regarding an important administrative matter.
-Ben
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And please do not post in all uppercase characters.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Ram ranch",
Please check your private messages regarding an important administrative matter.
-Ben
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Ram J",
Please check your private messages regarding an important administrative matter.
-Ben
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Arun Natarajan
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like what you are looking for is aspect oriented programming. AspectJ is one implementation that you could try.
 
Ramesh Kumar Swarnkar
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Arun,
I have also heard some how that it can be achieved by AOP. Moreover, I am very curious to achieve the same functionality of logging in my application.But I don't know how to write it, as I have never used AOP.
Can you please point some URL where I can get beginner level examples of AOP.

thanks in advance !!
[ June 18, 2008: Message edited by: Ramesh Kumar Swarnkar ]
 
Arun Natarajan
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can look at this URL for one of the several available implementation of AOP.
http://www.eclipse.org/aspectj/doc/released/progguide/index.html
 
Ramesh Kumar Swarnkar
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Arun for this link.


regards,
Ramesh
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic