Reputation: 424
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.
Upvotes: 0
Views: 107
Reputation: 71
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.
Upvotes: 1