[GRADLE-2040] Reduce log levels for the Tooling API Created: 11/Jan/12  Updated: 04/Jan/13  Resolved: 24/Jan/12

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 1.0-milestone-8

Type: Bug
Reporter: Gradle Forums Assignee: Szczepan Faber
Resolution: Fixed Votes: 0


First of all I want to thank you for the great work you have done with gradle.

At the moment i am trying to leverage the tooling api to execute embedded builds for a kind of of integration server. My problem is that the logoutput fills my console with messages like the following:
[Connection worker] DEBUG o.g.l.daemon.client.DaemonClient - Received object #332....

I have searched several hours for a hook to suppress this log messages or pipe them into a file.
Is there any possibility to configure/disable the logging of the DaemonClient or to redirect it into a file?

Comment by Gradle Forums [ 11/Jan/12 ]


It might be a bug. I expected to provide a configurable slf4j implementation and hence tweak the log levels but it didn't have the effect it should have had.

Few questions, first: what version of tooling api do you use and what gradle target version do you connect to?

Comment by Gradle Forums [ 11/Jan/12 ]

Thanks for your reply.
I am currently using the tooling api provided with m7 to connect to a gradle instance of version m7.
So both tooling api and gradle target version are m7.

Comment by Gradle Forums [ 11/Jan/12 ]

Cool. I'll do some digging and get back.

Comment by Gradle Forums [ 11/Jan/12 ]


Comment by Gradle Forums [ 11/Jan/12 ]

Currently you cannot easily configure the log levels for the Tooling API.

The tooling API is divided into consumer piece (the tooling api jar) and the provider piece (basically the target gradle you connect to). The log levels for consumer you should be able to configure in slf4j regular way, e.g. use configurable implementation of slf4j (for example, log4j), prepare the configuration and make sure the configuration is consumed (for log4j that would be log4.properties somewhere on the classpath).

However, for the provider you cannot easily change the log levels at the moment. I'm creating a jira ticket for it and I'm pretty sure we want to fix it soon.

The only workaround that comes to my mind is wrapping your System.out with something that can filter out the tooling api debug entries. I know it's not beautiful - we'll fix this problem definitely. Thanks for reporting!

Comment by Szczepan Faber [ 24/Jan/12 ]

I fixed this problem while solving the concurrency issue with slf4j. In M8 provider, the tooling API logging is set to INFO (I wasn't if it should be LIFECYCLE, though). It's not configurable by the client but it should reduce the level of logging significantly, as the tooling API provider is pretty thin and there's not too much logging even at INFO level.

If someone connects the tooling API to older gradle versions (<M8) the only workaround I see is replacing sys out/err.

Generated at Wed Jun 30 12:11:10 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.