ciscoo / cxf-codegen-gradle

Gradle plugin to generate Java artifacts from WSDL
Apache License 2.0
26 stars 6 forks source link

Disable CXF logs by default #89

Closed anderso closed 9 months ago

anderso commented 11 months ago

Getting rid of this would be nice, if it can be done, because it does not help anyone:

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.

Thanks for a great plugin, saved my day!

ciscoo commented 11 months ago

Hi, thanks for using the plugin, glad it helps.

What you are seeing is the default behavior of SLF4J when it can't find a concrete logging implementation.

SLF4J logs or prints to stderror which is why you see those lines when generating.

Review the documentation on logging which explains how to silence/disable those logs: https://ciscoo.github.io/cxf-codegen-gradle/docs/current/user-guide/#logging

anderso commented 11 months ago

Yes, thank you, I am aware and I followed the instructions to get rid of it. My point is that it would be nice if that wasn't necessary, IMHO a gradle task should not print output on success, unless there are pertinent warnings/deprecations that should be addressed. AFAICT this is the default behaviour of official gradle plugins.

But if you disagree or if it is difficult to acheive, please close this issue.

ciscoo commented 11 months ago

I agree and think it's worth investigating what can be done.

ciscoo commented 11 months ago

It's possible to suppress logs by adding a dependency on org.slf4j:slf4j-nop to the cxfCodegen configuration. Since this would be a change in existing behavior and various documentation updates, scheduling for the next minor release which will follow soon after 2.0.0 release.