binance-connector-java icon indicating copy to clipboard operation
binance-connector-java copied to clipboard

How to disable build-in logging mechanism

Open vckbarth opened this issue 2 years ago • 2 comments

I'm writing a piece of code that uses java-binance-api library and I have a problem. Every time I run program, it leaves so much logs from web services execution. Everything works just fine, so now I would like to disable this feature. But it seems to be hard coded and I don't see any attribute to disable it.

Please someone tell me how to do it - disable logging both to standard output and to file. But please do not write something like 'take source code from GIT and erase logger from code and then compile library for yourself' ;)

vckbarth avatar Sep 13 '22 18:09 vckbarth

OK. I assume that my problem cannot be solved without code changes. How to issue a something like 'change request' here in this forum to encourage someone to add new functionality (flag to classes like 'SpotClient') that could manage whether to enable or disable logging mechanism.

vckbarth avatar Sep 19 '22 18:09 vckbarth

Thanks for the feedback, we will make a design with better logging.

2pd avatar Sep 27 '22 12:09 2pd

@vckbarth Until it's resolved by the repo owners, you can define a logback-test.xml to suppress the library's logback.xml. An example:

<configuration>
  <!-- to override binance-java-connector's logback.xml -->
</configuration>

I know it's hacky but still bearable I would say :)

yavuztas avatar Oct 29 '22 18:10 yavuztas

I agree with this request, the logging configuration is the responsibility of the final application and not the library. I still can't find a way to remove it in my application and it's a problem: The microservices that we have running in a docker container should not reserve space for these log files, our architecture sends all this information to Grafana.

ricksoft avatar Jan 24 '23 00:01 ricksoft

We've now released a new version 2.0.0rc2 without logback-classic dependency, please have a try and if you encounter any problem, feel free to open a new Issue.

aisling-2 avatar Feb 16 '23 08:02 aisling-2

If logback-classic is used on the user-end, I believe the following can be put into backlog.xml file to suppress loggings from our lib: <logger name="com.binance.connector" level="OFF"/>

aisling-2 avatar Feb 16 '23 08:02 aisling-2

thanks!

ricksoft avatar Feb 16 '23 14:02 ricksoft