Announcement Announcement Module
No announcement yet.
Specific facade method execution logging Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Specific facade method execution logging

    how to solve following problem:
    I need to log information about all data that been created / updated / deleted in database after specific method execution in facade layer.

    I already have interceptor which is logging database changes, but I need special logging in special case, like described before.

    Thanks in advance.

  • #2
    Are you using Hibernate? If so it might be easier to have a look at the hooks it provides for this kind of thing.
    Last edited by karldmoore; Aug 29th, 2007, 10:47 AM.


    • #3
      Hi Karl, yes I'm using Hibernate (I forgot to mention), audit logging is done by extending EmptyInterceptor, but I need different kind of logging just in some particular use case.

      Lets say I have facade BlaBlaFacade against transaction, security, ... are defined. Lets some method makeRegistryChange() makes service call which execute really complex business logic and do insert / update / delete in several tables. Beside usual logging (who did what in what time), which is done by first Interceptor, I want to store all information about all data that have been saved / updated / deleted just in that particular case.

      For example: executing method makeRegistryChange() following objects has been created: Document, DocumentContent, DocumentProblems, RegistryEvent, ....

      I hope my question is clear. Do I need some kind of chained interceptors?



      • #4
        as far as i understand, you want to log not only service layer method calls, you also want to dao layer method calls within a specific service method call... I think you may consider to create a new logging interceptor for DAO layer calls. So you can produce such data:

        1- service (facade) method : "MyService.doBlaBla"
        1-1 DAO method : BlaDAO.createBla with parameters : x, y, z
        1-2 DAO method : AnotherBlaDAO.update with parameters : a, b, c.
        2- service (facade) method : "YourService.doSomethingElse

        You can read runtime method parameters, and construct a generic mechanism for logging those parameters.