How to resolve "log4j:WARN No appender could be found for logger"

How to resolve "log4j:WARN No appender could be found for logger"

book

Article ID: KB0083710

calendar_today

Updated On:

Products Versions
Spotfire Server 7.9 and later

Description

From 7.9 Spotfire has moved to using log4j 2.x, but some JDBC JARs (such as denodo, for example) still use log4j 1.x and may throw a warning when exporting the service configuration. The following is an example of such an error message, received when trying to use the export-service-config command to export the service configuration with the denodo JDBC JAR added to the {SpotfireServerinstall}/tomcat/lib folder:

log4j:WARN No appenders could be found for logger (com.denodo.vdb.jdbcdriver.configuration.ConfigurationParametersManager).
log4j:WARN Please initialize the log4j system properly

Issue/Introduction

This article provides a workaround to prevent the log4j warning in Spotfire Server when using an external JDBC JAR that still uses log4j version 1.x.

Resolution

Although these messages are benign, they can be prevented by including another log4j jar in the Spotfire Server installation. Apache provides a JAR which can help with patching log4j 1.x with log4j 2.x . This JAR can be downloaded from the following URL:
     http://apache.osuosl.org/logging/log4j/

At the time of writing this article, the latest version is 2.8.2:
     http://apache.osuosl.org/logging/log4j/2.8.2/apache-log4j-2.8.2-bin.zip

Unzip the downloaded file and place the log4j-1.2-api-2.8.2.jar in the following folder:
     {SpotfireServer7.9}\tomcat\webapps\spotfire\WEB-INF\lib

Restart the command prompt, then export the service configuration.

Additional Information

https://logging.apache.org/log4j/2.x/log4j-1.2-api/index.html