Skip to content
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

build: remove logback.xml from release jar #82

Open
theborakompanioni opened this issue Apr 24, 2023 · 2 comments
Open

build: remove logback.xml from release jar #82

theborakompanioni opened this issue Apr 24, 2023 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@theborakompanioni
Copy link
Collaborator

The current jar includes a logback configuration file.

If a downstream consumer also defines a logback.xml, logback will complain about it on stdout, which makes cln killing the plugin. This happens even with <root level="OFF"> and no console appender defined.

11:19:14,443 |-INFO in LoggerContext[default] - Found resource [logback.xml] at [file:/home/user/workspace/tapplication/build/resources/main/logback.xml]
11:19:14,443 |-WARN in LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
11:19:14,444 |-WARN in LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/home/user/workspace/application/libs/jrpclightning-0.2.4-SNAPSHOT.jar!/logback.xml]
11:19:14,444 |-WARN in LoggerContext[default] - Resource [logback.xml] occurs at [file:/home/user/workspace/application/build/resources/main/logback.xml]

Context: https://stackoverflow.com/questions/3401051/suppress-all-logback-output-to-console
Also: https://mailman.qos.ch/pipermail/logback-user/2010-August/001717.html

Logback only outputs its status messages when there is a warning or error - in this case Logback thinks that you have two logback.xml files on the classpath.

An additional side effect is that a clightning4j dir is created in the users home directory.
Would it be possible to exclude the logback.xml file in the release builds?

@vincenzopalazzo
Copy link
Member

Would it be possible to exclude the logback.xml file in the release builds?

I guess yes, but I need to see how I can do it with the current grade plugin, I guess this is the code that should include the fix https://github.com/clightning4j/JRPClightning/blob/master/gradle/release.gradle#L19

@vincenzopalazzo vincenzopalazzo added the enhancement New feature or request label Apr 24, 2023
@vincenzopalazzo vincenzopalazzo added this to the v0.3.0 milestone Apr 24, 2023
@theborakompanioni
Copy link
Collaborator Author

Would it be possible to exclude the logback.xml file in the release builds?

I guess yes, but I need to see how I can do it with the current grade plugin, I guess this is the code that should include the fix https://github.com/clightning4j/JRPClightning/blob/master/gradle/release.gradle#L19

I guess one can just include something like the following lines to the jar task in build.gradle:

    jar {
        exclude('logback.xml')
    }

But let's first consider whether it really makes sense or if some other approach is better suited. ; -)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants