[bisq-network/bisq] Remove Logback config xml from core module (#1954)

Chris Beams notifications at github.com
Fri Nov 23 07:26:25 UTC 2018


Usually Bisq is run from its 'shadow jar', i.e. the executable fat jar
that collapses all dependencies and resources into a single file. In that
scenario, only a single 'logback.xml' is included in the fat jar and all
is well.

However, when Bisq is run with a normal external classpath, e.g. from
within IDEA, when using `gradle :desktop:run` or when running one of the
Gradle-generated shell scripts under desktop/build/scripts, multiple
'logback.xml' files are present on the classpath, which causes Logback
to complain with messages like the following:

    Found resource [logback.xml] at [file:.../desktop/build/resources/main/logback.xml]
    Resource [logback.xml] occurs multiple times on the classpath.
    Resource [logback.xml] occurs at [file:.../desktop/build/resources/main/logback.xml]
    Resource [logback.xml] occurs at [jar:file:.../core/build/libs/core.jar!/logback.xml]

Note the last line above. The presence of 'logback.xml' in the bisq-core
jar is the 'duplicate'. This is Logback's way of warning the user that
it doesn't know which file should be considered canonical. The only way
to avoid this error message (and the many other lines that get output
along with it) is to remove the offending duplicate file.

This commit removes logback.xml from core to solve the problem described
above. The file is unnecessary in the context of running bisq-desktop,
bisq-seednode, etc, and the only context in which it would actually be
used is when running BisqHeadlessAppMain in core. With that said, the
configuration in the core logback.xml file is identical to the default
Logback configuration, so removing the file has no effect on the logging
output from BisqHeadlessAppMain, and furthermore, it appears that
BisqHeadlessAppMain is not actually in use anywhere right now (it was
added some months ago in anticipation of integrating the new HTTP API,
but this has yet to occur).

In a future change, we should probably return the core module to being a
pure library, without any main methods, and introduce a different
module, e.g. 'daemon' that contains the equivalent of
BisqHeadlessAppMain and whatever logback.xml configuration is
appropriate for it. Doing things this way will avoid the 'duplicate'
errors shown above, because desktop, seednode, etc will not depend on
core module, but will not depend on the daemon module.
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/1954

-- Commit Summary --

  * Remove Logback config xml from core module

-- File Changes --

    D core/src/main/resources/logback.xml (13)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/1954.patch
https://github.com/bisq-network/bisq/pull/1954.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/1954
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20181122/83b9a6a8/attachment-0001.html>


More information about the bisq-github mailing list