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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:55:45+00:00 2026-05-28T03:55:45+00:00

We spent a lot of time developing our own custom logging system (right or

  • 0

We spent a lot of time developing our own custom logging system (right or wrong, thats what the higher-ups decided on!) and I have been asked to write a custom SLF4J binding (API implementation) so that many of our SLF4J-utilizing components (such as Apache Camel) will start logging to our new homegrown system.

I have followed the instructions on SLF4J’s site to a “T”, creating:

  • A StaticLoggerBinder that SLF4J uses at runtime to bind to Loggers and LoggerFactory classes
  • A logger adaptor that will be used to “forward” org.slf4j.Logger calls on to
  • A logger factory (used by the static logger binder)

Everything compiles great. I jar it up and add it to the lib directory of a test project, along with slf4j-api-1.6.2.jar (the version they want me to use). I added both JARs to the build path in Eclipse.

I create a new Run Configuration for the test project, and under the Run Configuration’s Classpath tabbed pane I see it has User Entries >> TestBinding >> Slf4jBinding.jar and slf4j-api-1.6.2.jar.

So, it seems like both JARs are inside the Run Configuration’s classpath.

Upon running a driver inside the project that looks like this:

public static void main(String[] args) {
    Logger logger = LoggerFactory.getLogger(TestDriver.class);
    logger.error("Test");
}

I get the following runtime errors:

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

Going to that referenced site, it seems that SLF4J cannot find my StaticLoggerBinder on the classpath, which is inside the Slf4jBinding.jar, although not at the root level of the JAR.

I looked at SLF4J’s LoggerFactory.java source file and found the code that throws this kind of error:

private final static void bind() {
    try {
        // the next line does the binding
        StaticLoggerBinder.getSingleton();
        INITIALIZATION_STATE = SUCCESSFUL_INITILIZATION;
        emitSubstituteLoggerWarning();
    } catch (NoClassDefFoundError ncde) {
        String msg = ncde.getMessage();
        if (messageContainsOrgSlf4jImplStaticLoggerBinder(msg)) {
            INITIALIZATION_STATE = NOP_FALLBACK_INITILIZATION;
            Util
            .report("Failed to load class \"org.slf4j.impl.StaticLoggerBinder\".");
            Util.report("Defaulting to no-operation (NOP) logger implementation");
            Util.report("See " + NO_STATICLOGGERBINDER_URL
            + " for further details.");
        } // ...

Clearly, the call at the top of the try block (StaticLoggerBinder.getSingleton()) is throwing the NoClassDefFoundError. I just don’t understand why.

I elected not to paste my code here because I think this is just a classpath issue. Whether or not my code correctly adheres to SLF4J’s binding policies remains unknown until I can get passed this issue.

Is there an additional step I need to take inside Eclipse to configure the classpath? Could my Slf4jBinding.jar need StaticLoggerBinder inside its root for some reason? I am out of ideas here. Thanks in advance!

  • 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-28T03:55:45+00:00Added an answer on May 28, 2026 at 3:55 am

    Instead of starting completely from scratch then just adapt e.g. slf4j-simple.jar to your needs. All the binding code is there, you just need to adapt the code doing the actual logging.

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

Sidebar

Related Questions

I've spent a lot of time developing an operating system and working on my
I have spent lot of time doing research on VIM. I am Windows guy
I've spent a lot of time building out tests for my latest project, and
I spent lot time figuring out a simple regex to return a group (only
I spent lot of time in understanding ioc. I never understand how exactly control
I spent lot of time searching for it, but couldnt find. Dont blast me
I've spent a lot of time working in Django, and have grokked the framework
I spent a lot of time googling, now I'll try it here. Some of
I've spent a lot of time today trying to figure out how to get
Ok I've spent a lot of time reading all the various blog posts on

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.