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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:55:14+00:00 2026-05-24T02:55:14+00:00

SLF4J has a nice mechanism, where the implementation is chosen at runtime, depending of

  • 0

SLF4J has a nice mechanism, where the implementation is chosen at runtime, depending of what is available in the classpath. I would like to use such feature in several projects, for example to choose the communication layer or to choose a mock implementation.

I had a look at slf4j source to see how it’s done and I could just write something similar. Before I start, I would like to know if some lightweight FOSS library exists for this kind of injection.

  • 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-24T02:55:15+00:00Added an answer on May 24, 2026 at 2:55 am

    Unless you need specific configuration abilities as provided by Pico or Guice, you may get what you need from java.util.ServiceLoader.

    Basically, all you have to do is to package your service implementation in a JAR file, include a text file with a list of all implementation classes in “META-INF/services/” and on you go.

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

Sidebar

Related Questions

If I use slf4j and the classpath doesn't contain a logger implementation, it defaults
I'm trying to use Spring to inject a SLF4J logger into a class like
When you do something like LOG.debug(Exported {}., product) in slf4j it will eventually call
We're using slf4j in a java webapp, and i'd like to be able to
I have a project managed by maven with slf4j-api-1.5.8 and log4j-1.2.14 dependencies. At runtime,
I thought SLF4J would load org.slf4j.impl.StaticLoggerBinder via reflection but looking at the code in
I want to use default SLF4J + Logback configuration except setting org.springframework.data.document.mongodb logging level
I don't want to use something like this : Logger.getLogger(MyClass.class).info(Info message); each time I
Has someone tried to use MessagePack with an Android app? Is it possible? I
I use logback (via slf4j ) in a Java applet with configuration stored in

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.