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

  • Home
  • SEARCH
  • 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 6357213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:07:18+00:00 2026-05-24T23:07:18+00:00

On the Spring-based web app project I’m on now, the developers have written two

  • 0

On the Spring-based web app project I’m on now, the developers have written two logging statements into every function. One logging the entry into the function, the other logging the exit. The idea is to trace the execution path — at least a function level.

Is there a way to accomplish this without littering the entire code base with these repetitive statements?

To be clear, we want to log all functions, not just public methods of Spring beans.

  • 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-05-24T23:07:19+00:00Added an answer on May 24, 2026 at 11:07 pm

    You can do this with Spring AOP.

    Spring AOP will allow you to ‘intercept’ method calls and perform arbitrary code before and/or after the method call. You will also be able to examine parameters and return values of these methods.

    To achieve the logging you are talking about, you would do something like this, likely using the around advice:

    1. Intercept all method calls (or preferably, only the ones you are interested in).
    2. Do your ‘before method’ logging.
    3. Invoke the method.
    4. Do your ‘after method’ logging.

    All of the Spring details about how to do this can be found in the documentation provided.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a spring-based Web Service. I now want to build a sort of
I have my web application written in Spring MVC. It is quite simple app
We have a legacy web application (not Spring based) and are looking for best
We have a Spring + Ibatis based J2EE app. I planned to wrap around
I have a small console app containing a web server written in c#. When
I have an existing, fully functional Spring web application based on Spring 2.5.6 -
I am running a spring framework based web app on Tomcat. My requirement is
Quick question based on a spring web app i am creating. How do you
In a Spring 3 based web app I am using a custom implementation of
I'm writing a Spring 3 MVC based web app, using JSPs for my view

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.