Results 1 to 2 of 2

Thread: Design question to get custom logging object with ThrowsAdvice

  1. #1
    Join Date
    Jun 2005
    Location
    Philly
    Posts
    199

    Default Design question to get custom logging object with ThrowsAdvice

    I have a custom loggingService object that I want access to send a log to in the event that an ServiceException is thrown.

    I have a method that throws a ServiceException
    Code:
        
    private LoggingService loggingService;// initialized already
    
    public String generateClaimID(ClaimVO claimVO)
                throws ServiceException {
    
            try {
               //some stuff goes here
            } catch (IOException ioe) {
                  //logSessionId was already set on our custom logger
                  loggingService.log( Level.ERROR, "Not able to read the Claim Properties File: " + ioe);
                throw new ServiceException(
                        "Not able to read the Claim Properties File", ioe);
            }
    My question is how can I get access to loggingService in my LoggingInterceptor for ThrowsAdvice?

  2. #2

    Default

    You can use regular Spring IoC to inject a LoggingService into your aspect bean.

Posting Permissions

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