fasten-project / fasten

Analyse package dependency networks at the call graph level
https://www.fasten-project.eu
Apache License 2.0
86 stars 28 forks source link

How to increase the log verbosity for a kafka plugin. #443

Open michelescarlato opened 2 years ago

michelescarlato commented 2 years ago

@mir-am , @gdrosos , @MagielBruntink Hi Guys,

I would need to investigate an issue related to the Debian license feeder, and I was wondering if there is a way to increase the log verbosity (I am using DC).

Unluckily, several times I couldn't easily debug it. It usually gives a:

[2022-04-19 07:54:30,823] [INFO ] [main] [e.f.s.p.k.FastenKafkaPlugin] - Read normal message offset 0 from partition 0.
[2022-04-19 07:54:30,979] [INFO ] [main] [e.f.a.d.DebianLicenseFeederPlugin$DebianLicenseFeederExtension] - License feeder started.
[2022-04-19 07:54:31,020] [INFO ] [main] [e.f.a.d.DebianLicenseFeederPlugin$DebianLicenseFeederExtension] - Package name:
libgda5
[2022-04-19 07:54:31,040] [INFO ] [main] [e.f.a.d.DebianLicenseFeederPlugin$DebianLicenseFeederExtension] - Package version:
5.2.8-1
[2022-04-19 07:54:31,042] [INFO ] [main] [e.f.a.d.DebianLicenseFeederPlugin$DebianLicenseFeederExtension] - Package name: libgda5.
[2022-04-19 07:54:31,042] [INFO ] [main] [e.f.a.d.DebianLicenseFeederPlugin$DebianLicenseFeederExtension] - Package version: 5.2.8-1.
[2022-04-19 07:54:31,225] [INFO ] [main] [e.f.a.d.DebianLicenseFeederPlugin$DebianLicenseFeederExtension] - About to insert outbound licenses...
[2022-04-19 07:54:31,518] [ERROR] [main] [e.f.a.d.DebianLicenseFeederPlugin$DebianLicenseFeederExtension] - null
[2022-04-19 07:54:31,519] [INFO ] [main] [e.f.s.p.k.FastenKafkaPlugin] - Successfully processed normal message offset 0 from partition 0.
[2022-04-19 07:54:31,524] [INFO ] [main] [e.f.s.p.k.FastenKafkaPlugin] - Committed offsets [0] of partitions [0].

And I need to write several System.out.println to better understand where it gets stuck (in this case seems an error related to the insertOutboundLicense function, but I would like to have more details).

Thanks for your time.

proksch commented 2 years ago

What I do in the new data processing repo is to 1) enforce slf4j logging (you need to add bridges in the dependencies and 2) use custom LoggingUtils to set the verbosity... this sets the same level for everything though.

You can also play around with custom logger settings, which you normally have to put into a correctly named xml file as a resource, but I do not remember which logging framework Kafka is using (and the file name and its options depend on the framework).