Results 1 to 2 of 2

Thread: Full web request log

  1. #1
    Join Date
    Aug 2009
    Posts
    1

    Default Full web request log

    Hi everyone,

    I am developing web API-like application. Users do RESTful style requests to my API and I need (that is a requirement) to log every such request into the database, including IP, URL, Request Method (GET/POST/PUT/DELETE), Request Body (XML), Response Body (XML), Date, Response time (how long took the request), Response HTTP status (200, 409, etc.) and SQL queries that have been run during the request.

    So most of the information I have already logging into the database using LoggerInterceptor which extends HandlerInterceptorAdapter.

    But with SQL queries that have been run during the request I have a litle problem. I use there iBATIS with Spring. And the only way I found (yet) how to intercept the prepared statements and parameters is using custom log4j.appender and parsing all the log data (parsing to get exact queries and parameters) and mapping then that data to the request.

    So I want to ask, is there any cleaner/proper/easier way to log SQL queries with each request into the database?

    Thanks in advance for any idea, advice.

  2. #2
    Join Date
    Feb 2009
    Posts
    136

    Default

    Hi

    I would also like to do similar thing. but bit confused if i should use filters or interceptors or AOP.

    can you provide some detail info on how you are handling it.

    If my app is having multiple DispatcherServlets one for spring MVC other for flex clients(blazeds), then I think we need to define interceptors in each DispatcherServlets , In such case filter is good option ?
    Last edited by kannanMugundan; Dec 3rd, 2011 at 03:55 AM.

Tags for this Thread

Posting Permissions

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