Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

slf4j-api vs slf4j-log4j12 in API
 Post subject: slf4j-api vs slf4j-log4j12 in API Post rating: 0   New post Posted: Wed 03 Aug, 2016, 10:26 

User rating: 6
Joined: Tue 02 Jul, 2013, 16:52
Posts: 38
Dear Support,

With the latest API version (currently 2.45.50 in my pom.xml), I have issues with the logs using slf4j-log4j12 in my own development, as my own logging now behaves in an erratic way.
Looking at the slf4j documentation, I found:

Quote:
Embedded components such as libraries or frameworks should not declare a dependency on any SLF4J binding but only depend on slf4j-api. When a library declares a compile-time dependency on a SLF4J binding, it imposes that binding on the end-user, thus negating SLF4J's purpose. When you come across an embedded component declaring a compile-time dependency on any SLF4J binding, please take the time to contact the authors of said component/library and kindly ask them to mend their ways.
From what I have seen, this seems to be the case with the Dukascopy API as I see declarations to slf4j-log4j. I don't know if this is what is causing the problems with my logs, but I am taking the time to inform you ...

Best,


 
 Post subject: Re: slf4j-api vs slf4j-log4j12 in API Post rating: 0   New post Posted: Wed 03 Aug, 2016, 14:33 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please give an example mvn project that would reproduce the issue.


 
 Post subject: Re: slf4j-api vs slf4j-log4j12 in API Post rating: 0   New post Posted: Wed 03 Aug, 2016, 16:08 

User rating: 6
Joined: Tue 02 Jul, 2013, 16:52
Posts: 38
You can see what I am referring to with slf4j documentation and running "mvn dependency:tree -Dverbose -Dincludes=org.slf4j"
Here is my output as an example.
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ forex-app ---
[INFO] forex:forex-app:war:beta
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.21:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] +- com.dukascopy.dds2:DDS2-jClient-JForex:jar:2.45.50:compile
[INFO] |  +- com.dukascopy.dds2:DDS2-Charts:jar:6.23.53:compile
[INFO] |  |  \- com.dukascopy.dds2:greed-common:jar:317.57:compile
[INFO] |  |     +- com.dukascopy.dds2:ui-core:jar:1.5.28:compile
[INFO] |  |     |  \- (org.slf4j:slf4j-api:jar:1.7.12:compile - omitted for conflict with 1.7.21)
[INFO] |  |     +- com.dukascopy.dds4:transport-client:jar:0.4.104:compile
[INFO] |  |     |  \- com.dukascopy.dds4:transport-common:jar:0.5.86:compile
[INFO] |  |     |     \- (org.slf4j:slf4j-api:jar:1.7.13:compile - omitted for conflict with 1.7.21)
[INFO] |  |     \- com.dukascopy:auth-protocol-client:jar:1.0.3:compile
[INFO] |  |        \- (org.slf4j:slf4j-api:jar:1.7.10:compile - omitted for conflict with 1.7.21)
[INFO] |  +- org.fife:DDS2-TextEditor:jar:1.27.6:compile
[INFO] |  |  \- (org.slf4j:slf4j-api:jar:1.7.12:compile - omitted for conflict with 1.7.21)
[INFO] |  +- (org.slf4j:slf4j-log4j12:jar:1.7.12:compile - omitted for conflict with 1.7.21)
[INFO] |  +- com.dukascopy.docking.framework:CleanDocking:jar:2.0.23:compile
[INFO] |  |  \- (org.slf4j:slf4j-log4j12:jar:1.7.12:compile - omitted for conflict with 1.7.21)
[INFO] |  \- com.dukascopy.dds2:Login-Form:jar:1.5.27:compile
[INFO] |     \- (org.slf4j:slf4j-log4j12:jar:1.7.12:compile - omitted for conflict with 1.7.21)
[INFO] +- org.quartz-scheduler:quartz:jar:2.2.3:compile
[INFO] |  \- (org.slf4j:slf4j-api:jar:1.7.7:compile - omitted for conflict with 1.7.21)
[INFO] \- org.jadira.usertype:usertype.core:jar:5.0.0.GA:compile
[INFO]    +- (org.slf4j:slf4j-api:jar:1.7.12:compile - omitted for conflict with 1.7.21)
[INFO]    \- org.jadira.usertype:usertype.spi:jar:5.0.0.GA:compile
[INFO]       \- (org.slf4j:slf4j-api:jar:1.7.12:compile - omitted for conflict with 1.7.21)
As you can see other dependencies use slf4j-api, but Dukascopy has a dependency to a binding (slf4j-log4j12:jar)
See https://www.slf4j.org/manual.html

Best,


 
 Post subject: Re: slf4j-api vs slf4j-log4j12 in API Post rating: 0   New post Posted: Wed 17 Aug, 2016, 15:25 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We were unable to reproduce this issue. Please provide full maven project example


 
 Post subject: Re: slf4j-api vs slf4j-log4j12 in API Post rating: 0   New post Posted: Mon 03 Oct, 2016, 12:08 

User rating: 0
Joined: Mon 03 Oct, 2016, 12:01
Posts: 1
Location: ItalyItaly
As a workaround, you could exclude in your pom.xml the direct slf4j-log4j12 dependency and replace it with the slf4j-api dependency:

<dependency>
<groupId>com.dukascopy.dds2</groupId>
<artifactId>DDS2-jClient-JForex</artifactId>
<version> 2.45.50</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>


 

Jump to:  

  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com