| Author |
Is there a way to handle logging of exceptions.
|
ram kumar
Ranch Hand
Joined: May 22, 2008
Posts: 146
|
|
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.
|
Discussion - the powerfull way to excellence!
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
"Ram ranch", Please check your private messages regarding an important administrative matter. -Ben
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56175
|
|
|
And please do not post in all uppercase characters.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
"Ram ranch", Please check your private messages regarding an important administrative matter. -Ben
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
"Ram J", Please check your private messages regarding an important administrative matter. -Ben
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
"java spring", Please check your private messages. -Ben
|
 |
Arun Natarajan
Ranch Hand
Joined: Jul 21, 2006
Posts: 30
|
|
|
Sounds like what you are looking for is aspect oriented programming. AspectJ is one implementation that you could try.
|
 |
Ramesh Kumar Swarnkar
Ranch Hand
Joined: Sep 15, 2003
Posts: 83
|
|
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
Joined: Jul 21, 2006
Posts: 30
|
|
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
Joined: Sep 15, 2003
Posts: 83
|
|
Thank you very much Arun for this link. regards, Ramesh
|
 |
 |
|
|
subject: Is there a way to handle logging of exceptions.
|
|
|