0

I am developing a Java SDK which shall be used by different teams and products using different Java frameworks. I want to expose a way such that the consumer of my SDK can enable logging in my SDK, and then all the log statements within my SDK can be captured to their specified file/console. Or otherwise by default the logging will be disabled without any logs from the SDK. Is there a standard/suggested way to achieve this, what kind of Logger my SDK shall be using, and how will it integrate with the logger being used by the consuming service.

2
  • 3
    slf4j.org Commented Feb 2, 2018 at 9:57
  • 1
    slf4j or java.util.logging Commented Feb 2, 2018 at 10:03

1 Answer 1

1

One way would be to use java.util.logging.Logger in your SDK und a logger.properties file on client site. In this file, the classes in your SDK can be disabled by default and enabled when needed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.