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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:38:27+00:00 2026-05-24T18:38:27+00:00

I am thinking off migrating a java 1.4.2 project from log4j to slf4j. It

  • 0

I am thinking off migrating a java 1.4.2 project from log4j to slf4j. It is the advantage of parameterised logging and the code clarity (no need if log.isdebug..) That is drawing me to such considerations.

Are there performance overheads of converting to slf4j?

Last time I checked if I could use logback, it has a requirement on the jdk which mandates it to be att least 1.5 which is why I am considering slf4j and log4j.

  • 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-24T18:38:28+00:00Added an answer on May 24, 2026 at 6:38 pm

    No, you should get a performance advantage from slf4j if anything, because (if you use parameterized messages) then slf4j defers turning its parameters to strings until it has checked that the message won’t be filtered out by log level:

    There exists a very convenient alternative based on message formats. Assuming entry is an object, you can write:

    Object entry = new SomeObject();
    logger.debug("The entry is {}.", entry);
    

    After evaluating whether to log or not, and only if the decision is affirmative, will the logger implementation format the message and replace the ‘{}’ pair with the string value of entry. In other words, this form does not incur the cost of parameter construction in case the log statement is disabled.

    The following two lines will yield the exact same output. However, the second form will outperform the first form by a factor of at least 30, in case of a disabled logging statement.

    logger.debug("The new entry is "+entry+".");
    logger.debug("The new entry is {}.", entry);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is a project I'm off to start and thinking of using SQL CE
So I am thinking about building a hobby project, one off kind of thing,
Thinking about getting into .net technology project management I've had plenty of experience with
Thinking about avoiding code replication, I got a question that catches me every time
Thinking about if we modify the definition of Hamiltonian path as we need to
Currently thinking about pitching the argument for us migration from vs 2005 (winforms) to
Am I correct in thinking that to change the checkmark for on to off,
I've put off WPF development for a quite a while but, I'm finally thinking
First off; I am not necessarily looking for Delphi code, spit it out any
To start off with - this app doesn't need to get into the App

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.