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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:14:05+00:00 2026-06-08T18:14:05+00:00

I want to provide a client-library for wrapping rest-request to a server and log

  • 0

I want to provide a client-library for wrapping rest-request to a server and log errors, so that a client can use it in his app and also see the logs. (There is also a question if i should just log the errors or rethrow it. When i use an asynchronized call (multithreaded) this might be quite tricky..)

I read that slf4j might help, because the client, who is using the library, can choose which logging framework he prefers.

Somethings puzzles me about this slf4j-thing. If he gets my library and i just provide, let’s say the slf4j-api, errors will be thrown, cause the SLF4J bindings aren’t included. The solution might be that he has to include the binding on his own, and the question is if he is willing to read the README for this crucial information.

If i include one “standard”-slf4j binding (e.g. the simple one), the app can’t “override” this, because there is just one binding allowed on the classpath. It won’t be flexible anymoe

So i am thinking to just use log4j and forget every other logging-framework. I may think to complicated on this subject, maybe someone might help me out on this?

  • 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-08T18:14:06+00:00Added an answer on June 8, 2026 at 6:14 pm

    You have to remember, your library does not set the wrapping application’s classpath. The wrapping application will set a classpath that includes your library, the slf4j API library and the implementing library.

    The wrapping application will take care of what slf4j implementation to use and setup all of the logging parameters. You just need to worry about logging your libraries events with the slf4j API. This is common practice, don’t worry about the wrapping application.

    By packaging log4j within your library, you are defeating the purpose of a logging facade. Doing so will not allow the user to pick the slf4j implementation.

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

Sidebar

Related Questions

I want to use linqToTwitter library to create my own twitter client. How can
I'm developing a FB page tab app, and I want to provide my client
I want to provide a virtual webcam via DirectShow that will use the video
Possible Duplicate: Best way to provide charts on the web? Server-side or client-side library?
I want sell some .NET library and I want provide edition with full source
I want to provide a custom Batcher for Hibernate to use (for this reason:
I want to create a Qt widget that can play incoming RTP streams where
I have a client application that connects to a server. The server uses hibernate
This is my first time trying to use the XMLRPC::Client library to interact with
I understand why REST framework vendors want to provide the support for returning both

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.