0

I am using jose4j in a java application that I am working on. It is a json web token library, and I've found that putting the package name inside my log4j config file does nothing to quiet the (many) debug logging messages that I am seeing from this thing. Here's my relevant log4j config section

<Root level="debug">
    <AppenderRef ref="Console"></AppenderRef>
</Root>
<Logger name="org.jose4j" level="warn" additivity="false">
    <AppenderRef ref="Console"></AppenderRef>
</Logger>

So, I essentially only want to see log messages from jose4j when they rise to the level of warn (or more dire).

A few things I have been able to gather.

  • Setting the root logger to "info" does make the jose4j debug messages go away, so jose4j's logger at least knows about my logging setup.

  • It looks like the logger that jose4j uses is org.sl4j

  • I had a similar issue yesterday. It seemed like adding a few jars did the trick to fix that issue, but I'm not having luck with this.

I also added this jar to the classpath... this also did not work.

Does anyone know how I can get this library to work with my logging setup?

Zack
  • 13,454
  • 24
  • 75
  • 113
  • From the maven dependencies of jose4j (see http://search.maven.org/#artifactdetails%7Corg.bitbucket.b_c%7Cjose4j%7C0.5.7%7Cjar), it looks like the logging system used by the SLF4J facade is Logback . So the configuration would probably have to be a logback.xml file. – Arnaud Jun 21 '17 at 13:42
  • Would I have to put this alongside my log4j config file? Is this possible? – Zack Jun 21 '17 at 13:44
  • You may test this at least to see if this config is taken into account by jose4j . Later it would be better that all classes use the same configuration, in that case for your custom libraries, either migrate your logging code to SLF4J , or use the log4j-over-slf4j bridge, see here : https://www.slf4j.org/legacy.html – Arnaud Jun 21 '17 at 13:49
  • I added a logback.xml as seen [here](https://logback.qos.ch/manual/configuration.html), but it doesn't seem to effect anything. Set the logback level to "warn" – Zack Jun 22 '17 at 15:22

1 Answers1

0

Two points:

foal
  • 693
  • 7
  • 20