kermitt2 / biblio-glutton

A high performance bibliographic information service: https://biblio-glutton.readthedocs.io
125 stars 16 forks source link

log settings not working #26

Closed kermitt2 closed 5 years ago

kermitt2 commented 5 years ago

Logging appender settings are not working

ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...

When adding log4j-core to the classpath

ERROR StatusLogger No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2

when adding a Log4j config, it also breaks at build time...

I remember having a similar problem with grobid + gradle + dropwizard, and it relies on some gradle I think.

kermitt2 commented 5 years ago

At least to turn off logging into the console of the kilometers of requests, we can do in the service config file:

server:
  ...
  requestLog:
    appenders: []
lfoppiano commented 5 years ago

Good to have this issue opened.

I've seen this issue already, indeed I need to figure out which library needs log4j 2 which should not be used since dropwizard uses logback.

lfoppiano commented 5 years ago

BTW I just notice that I committed by mistake level: TRACE in the config.yml, changing that to WARN should reduce the amount of logs. Sorry...

lfoppiano commented 5 years ago

The amount of log should be fixed in a07fed89cd02ebc6817f4941979615bcf5a70216

kermitt2 commented 5 years ago

Thanks! It works as expected too when removing the console appender for instance.

We still have the no Log4j2 implementation found error (ERROR StatusLogger Log4j2 could not find a logging implementation), but as it seems working fine...

lfoppiano commented 5 years ago

@kermitt2 good. I'll deal with the error another time, might take long.

lfoppiano commented 5 years ago

The error is coming from the elasticserach client, which uses log4j 2. No idea how to fix it or make it disappear, honestly...

lfoppiano commented 5 years ago

Thanks to https://stackoverflow.com/questions/56212209/log4j-2-conflicts-in-a-dropwizard-application?noredirect=1#comment99053868_56212209 I found a solution...

Let me know if it improves

kermitt2 commented 5 years ago

No more Log4j implementation found error and everything seem working fine ! Thanks !