Results 1 to 5 of 5

Thread: How to implement this kind of Logging

  1. #1

    Unhappy How to implement this kind of Logging

    Hello, in my web project, I use Spring Framework. In UI part, there are several links for example, one button link is "Article", inside, login user can download or read online articles, another button link is "purchase", inside, user can do all the process to purchase the books.

    Above is from user's point of view. Then technically speaking, when user click "article" button, Controller mapped jsp file will be loading and direct user to the Article page, eg, article.jsp. Then, according to the actions by user, application will invoke the methods in Service layer, eg. /Services/articleService.java.

    The same thing for "purchase".

    Now, I want my application also get the data of how long time the user is inside "article", how long time user is inside "purchase". To implement this I think I need to use AOP. But my current knowledge is, use AOP, it is easy to get the time duration about which method is invoked.For example, inside articleService.java there is a method reading(), use AOP I can get the Logging data about how much milliseconds this method is invoked.

    My question is, how to get the data of how long time the user is inside "article" part without concern which particular method is invoked, without concern the time used to invoke any particular method. Please Help.

  2. #2

    Default Help, any suggestions?

    No body has any suggestions? Help

  3. #3
    Join Date
    Nov 2006
    Location
    Germany
    Posts
    452

    Default

    Hi,

    do you want to track the "user think time" inside your application ?
    One way to do this with AOP is to save the time when the user enters i.e. Article through an after advie (then the user think time starts).
    After capturing the time you have to save it somewhere in your webapp (i.e. HTTPSession), when the user hits the button again to leave "Article" then you will need an before advice, which handles the stuff like logging the difference between the start time (save in http session) and the actual time when the before advice is called.

    Hope this helps.

    best regards
    agim

  4. #4

    Default About the user leaving time

    Quote Originally Posted by Lyserg View Post
    Hi,

    do you want to track the "user think time" inside your application ?
    Yes, I mean that, I want to get the time duration that user is inside "article", without concern which article link user clicked. Get the total inside time is my point.

    Quote Originally Posted by Lyserg View Post
    ...
    when the user hits the button again to leave "Article" then you will need an before advice, which handles the stuff like logging the difference between the start time (save in http session) and the actual time when the before advice is called.
    Because there are 6 link buttons, user leave the "Article" part is not by click the "Article" button again, it is not logical, user can click any other link button to another part of the application, which means the user leave the "Article" part, that's the most difficult thing to get the user leaving time. So, any other proposal for the leaving time??

  5. #5

    Smile MethodInterceptor

    hi,
    i think u use MethodInterceptor which is round advice

Posting Permissions

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