Announcement Announcement Module
Collapse
No announcement yet.
How to trace logs using AOP? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to trace logs using AOP?

    We are implementing a Web Service and would like to log the 'flow' of the request using AOP and have the log entries grouped and ordered by each request. We tried different approaches so far but none worked as expected. Is it possible to achieve this funcitionality with AOP? ex:


    #### Request 1 ​####

    2014-01-30 16:06:12,766[http-localhost-127.0.0.1-8080-1] ERROR br.com.gid.ws.domain.service.business.BusinessRule s Wrong encryption Error
    2014-01-30 16:06:12,782[http-localhost-127.0.0.1-8080-1] ERROR br.com.gid.ws.domain.service.business.BusinessRule s br.com.gid.ws.domain.exception.ServiceException: ERROR_WRONG_ENCRYPTION
    2014-01-30 16:06:12,782[http-localhost-127.0.0.1-8080-1] ERROR br.com.gid.ws.domain.service.PerfilMediator Erro ao adicionar perfil br.com.gid.ws.domain.exception.ServiceException: ERROR_CRIPTOGRAFIA_INVALIDA
    2014-01-30 16:06:12,784[http-localhost-127.0.0.1-8080-1] INFO br.com.gid.ws.interfaces.impl.GidWsNDSOiVendeImpl ########## adicionarPerfilOiVende - Inicio : Thu Jan 30 16:06:07 BRST 2014 - Fim : Thu Jan 30 16:06:12 BRST 2014##########

    #### Request 2 ​####

    2014-01-30 16:06:12,766[http-localhost-127.0.0.1-8080-1] ERROR br.com.gid.ws.domain.service.business.BusinessRule s Wrong encryption Error
    2014-01-30 16:06:12,782[http-localhost-127.0.0.1-8080-1] ERROR br.com.gid.ws.domain.service.business.BusinessRule s br.com.gid.ws.domain.exception.ServiceException: ERROR_WRONG_ENCRYPTION
    2014-01-30 16:06:12,782[http-localhost-127.0.0.1-8080-1] ERROR br.com.gid.ws.domain.service.PerfilMediator Erro ao adicionar perfil br.com.gid.ws.domain.exception.ServiceException: ERROR_CRIPTOGRAFIA_INVALIDA
    2014-01-30 16:06:12,784[http-localhost-127.0.0.1-8080-1] INFO br.com.gid.ws.interfaces.impl.GidWsNDSOiVendeImpl ########## adicionarPerfilOiVende - Inicio : Thu Jan 30 16:06:07 BRST 2014 - Fim : Thu Jan 30 16:06:12 BRST 2014##########

    thanks

  • #2
    Not sure you can do this with Spring AOP. This sounds like a task to be done after the logs were already generated, with some script.

    Also, please note that we are currently in the process of moving to stackoverflow.com for our forums. If you're still having questions please consider asking them at http://stackoverflow.com using the #spring tag and someone should be able to help you. Thanks!

    Comment

    Working...
    X