Announcement Announcement Module
Collapse
No announcement yet.
Design question to get custom logging object with ThrowsAdvice Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    You can use regular Spring IoC to inject a LoggingService into your aspect bean.

    Comment

    Working...
    X