Skip to content

CLI: Prevent mixture of logging and CLI output #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hohwille opened this issue Aug 3, 2016 · 5 comments
Open

CLI: Prevent mixture of logging and CLI output #194

hohwille opened this issue Aug 3, 2016 · 5 comments
Assignees
Labels
enhancement util-cli support for building complex Command-Line-Interfaces (CLI)
Milestone

Comments

@hohwille
Copy link
Member

hohwille commented Aug 3, 2016

By default CLI (from AbstractMain) should somehow configure the logging such that is silent and does not interfere with the CLI program output.
As advanced feature an option or system property should allow to configure the logging to use a specific config file so log messages are printed on console or written to log file.
However CLI users do not want to see the ugly 3 lines of SLF4J that no logger binding exists nor want to see the error messasges such as that javax.validation may not be on their classpath, etc. by default.

@hohwille hohwille added enhancement util-cli support for building complex Command-Line-Interfaces (CLI) labels Aug 3, 2016
@hohwille hohwille added this to the release:7.3.0 milestone Aug 3, 2016
@hohwille hohwille self-assigned this Aug 3, 2016
@hohwille
Copy link
Member Author

hohwille commented Aug 4, 2016

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.

It seems we are hitting a limitation of slf4j here:
http://www.slf4j.org/codes.html#StaticLoggerBinder

For a CLI program no end user want to see this 3 lines from slf4j mixed in the CLI output if no logger binding is found on the classpath. Therefore slf4j should offer a way to suppress this warning e.g. via a system property.

@hohwille
Copy link
Member Author

hohwille commented Aug 4, 2016

If on the other hand we would ship CLI with logback as dependency (or even slf4j-nop what is IMHO both wrong) then we would also need to ship a logback config that prevents any logoutput by default. This would again interfere with projects that just have our lib as dependency for other reasons.
It seems that we have a specific use-case that slf4j team probably never thought about...

@hohwille
Copy link
Member Author

hohwille commented Aug 4, 2016

@hohwille
Copy link
Member Author

hohwille commented Jun 8, 2017

qos-ch/slf4j#157

Unfortunately no reaction.

@hohwille
Copy link
Member Author

slf4j does not seem to care about its PRs. I also posted on the mailing list and others have the same problem and their PRs are not commented since over one year. Hence, I am removing the milestone to prevent blocking other issues being solved for the release.

@hohwille hohwille modified the milestones: release:7.5.0, unplanned Sep 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement util-cli support for building complex Command-Line-Interfaces (CLI)
Projects
None yet
Development

No branches or pull requests

1 participant