Results 1 to 3 of 3

Thread: How to avoid logging caught exception using AOP?

  1. #1
    Join Date
    Aug 2009
    Posts
    14

    Default How to avoid logging caught exception using AOP?

    Hi,

    In a nutshell i am trying to avoid logging the caught exceptions at pointcut.

    I am using @AfterThrowing to log the exceptions happening in the system and from my understanding regardless of the exceptions is caught or not the aspect executes and do its' work(in this case loging). what i dont want to do is not to log any exceptions which is caught in the applciation. is there anyway i can do that? or my understanding is wrong?

    any help to make me understand better is appreciated.

    ta
    venkatesh

  2. #2
    Join Date
    Apr 2008
    Location
    Seville, Spain
    Posts
    133

    Default

    I'm not sure if AOP is good for this. Java 5 provides the Thread.UncaughtExceptionHandler interface for this purpose.

    Cheers
    Jose Luis Martin
    Freelance Senior Consultant
    JDAL - Java Database Application Library

  3. #3
    Join Date
    Aug 2009
    Posts
    14

    Default

    Thanks Chelu,

    i never used Thread.UncaughtExceptionHandler before. will have a look at it.

    ta
    venkatesh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •