Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7888071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:44:39+00:00 2026-06-03T05:44:39+00:00

I have a small project that is written in Groovy and deployed as a

  • 0

I have a small project that is written in Groovy and deployed as a groovlet on Tomcat 6.0.
My issue now that I need to monitor all incoming requests and perform on each request custom logging.

First I thought to include into each class a short code that outputs what I need, but then I figured may be Tomcat can send/duplicate each incoming http request to my custom logging class that will parse it to my liking and perform few more things.

Is it possible to do so? If so how?

P.S: Tomcat must be original – no modifications/custom compilations.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:44:40+00:00Added an answer on June 3, 2026 at 5:44 am

    You can add a custom filter that will do the logging.

    Here is a sample Filter implementation:

    public class YourFilter implements Filter {
    
        public void init(FilterConfig filterConfig) throws ServletException {
            // do your initialization here
        }
    
        public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
            throws IOException, ServletException {
            // do your custom logging here
        }
    
        public void destroy() {
            // do whats necessary on end of life
        }
    }
    

    Configure/activate the Filter inside the web.xml.

    ...
    <filter>
        <filter-name>yourFilter</filter-name>
        <filter-class>org.example.YourFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>yourFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>  
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a small Android project that shows some (image)buttons. It works fine
I have a small project that I will be working on shortly that collects
I have a small project and I noticed that I have a lot of
I have a small- to medium-size project that I am doing for my software
I have a small RIA that I built as a learning/make-my-life-easier project that uses
I am working on a small project that sends SMS Messages. I already have
I have a small project that uses libglade and use the following to load
I have written a small unit test for my django view .My project structure
I have a small project to record some form input on a page that's
I've got a relatively small ASP.NET project that was written using C# 4.0. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.