OneBusAway / onebusaway-gtfs-modules

A Java-based library for reading, writing, and transforming public transit data in the GTFS format, including database support.
Other
129 stars 106 forks source link

No logging for merge-cli #223

Closed markusstraub closed 1 year ago

markusstraub commented 1 year ago

Running the merge CLI tells me that logging is broken:

java -jar onebusaway-gtfs-merge-cli-1.4.4.jar a.zip b.zip out.zip
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier.
SLF4J: Ignoring binding found at [jar:file:/REDACTED/onebusaway-gtfs-merge-cli-1.4.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See https://www.slf4j.org/codes.html#ignoredBindings for an explanation.

Reading documentation mentioned in the last line I thought this would help:

java -cp slf4j-simple-2.0.7.jar -jar onebusaway-gtfs-merge-cli-1.4.4.jar a.zip b.zip out.zip

But unfortunately I get the same messages.

Platform: OpenJDK 17, Ubuntu 22.04

markusstraub commented 1 year ago

Note, that everything works as expected until version 1.3.118. Later versions switched to slf4j 2.x, that's where the problem starts to arise.

sheldonabrown commented 1 year ago

@markusstraub Do you happen to have a fix for this?

markusstraub commented 1 year ago

Not really, but I think in addition to log4j-slf4j-impl you need to add a dependency to e.g. slf4j-simple which will then contain a logging provider as the documentation states:

This can be solved by placing an SLF4J provider on your classpath, such providers include logback version 1.3.x and later, as well as one of slf4j-reload4j, slf4j-jdk14, slf4j-simple version 2.0.0 or later.

sheldonabrown commented 1 year ago

Thanks, it looks like the log4j-impl I'm using is being ignored. I'll have this resolved shortly.

sheldonabrown commented 1 year ago

Fixed. I'll release it now