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 8421081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:02:44+00:00 2026-06-10T03:02:44+00:00

I am trying to integrate Perf4j v0.9.16 with log4j v1.2.17. Below is Utils class

  • 0

I am trying to integrate Perf4j v0.9.16 with log4j v1.2.17.

Below is Utils class which has a method.

public class Utils {

    private static Logger logger = Logger.getLogger(Utils.class);

    @Profiled
    public String checkNullValueForString(Object obj)
    {
        String resultStr = "";
        if(obj != null)
        {
            logger.info("Object is not null.");
            resultStr = String.valueOf(obj);
        }
        logger.info("Resultstr is "+resultStr);
        return resultStr;
    }
}

Below is log4j.properties file:

# Define the root logger with appender file
log = /usr/home/log4j
log4j.rootLogger = DEBUG, FILE
org.perf4j.log4j = INFO

# Define the file appender
log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.File= logs/log.out

# Define the layout for file appender
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.conversionPattern=%m%n

When i run the utils method its print the logger message but perf4j logger doesn’t print.

Please help.

  • 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-10T03:02:46+00:00Added an answer on June 10, 2026 at 3:02 am

    From the Perf4J documentation

    the Profiled annotation by itself just marks a method for profiling –
    it does not actually add any timing code. Instead, you must use an
    aspect-oriented programming framework, such as AspectJ or Spring AOP
    to inject timing aspects into your code.

    There are aspect classes provided for both the above AOP frameworks. You just need to add some configuration files to get going.

    Read the Perf4J documentation at http://perf4j.codehaus.org/devguide.html#Unobtrusive_Logging_with_Profiled_and_AOP to understand how to do this.

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

Sidebar

Related Questions

I'm trying to integrate Jawr into my Spring application: <bean abstract=true id=jawrBase class=net.jawr.web.servlet.JawrSpringController> <property
I'm trying to integrate a public message board service into an existing web site.
Trying to integrate some friendly_id gem functionality on a controller method. Essentially, I have
Im trying to integrate Brad Larson's GPUImage framework to my project. The sample code
I'm trying to integrate Video4Linux in my managed application. Indeed I've declared all required
I'm trying to integrate passport into my nodejs server using connect, but can't seem
Hi I'm trying to integrate MySpace with my Android app. As I'm new to
I am currently trying to integrate Paypal's MECL in an already existing IOS project
I am trying to integrate the new Open Graph objects , actions and aggregations
I am trying to integrate a simple login for my site with php. 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.