Skip to content

Can't resolve deprecation warning for MongoDb/MongoDb4 appender #3151

@garydgregory

Description

@garydgregory

Description

I can't avoid the warning:

2024-11-01T02:59:36.909352800Z main WARN The MongoDb4 Appender is deprecated, use the MongoDb Appender.

I wonder if I missed a migration step.

Configuration

Version: 2.24.1

Microsoft Windows [Version 10.0.19045.5011]
~
openjdk version "17.0.12" 2024-07-16
OpenJDK Runtime Environment Temurin-17.0.12+7 (build 17.0.12+7)
OpenJDK 64-Bit Server VM Temurin-17.0.12+7 (build 17.0.12+7, mixed mode, sharing)
~
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: C:\java\apache-maven-3.9.9
Java version: 17.0.12, vendor: Eclipse Adoptium, runtime: C:\Program Files\Eclipse Adoptium\jdk-17.0.12.7-hotspot
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
~
Docker version 27.3.1, build ce12230## Logs

2024-11-01T02:59:36.909352800Z main WARN The MongoDb4 Appender is deprecated, use the MongoDb Appender.

Reproduction

I migrated my POM from log4j-mongodb4 to log4j-mongodb:

    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-mongodb</artifactId>
      <optional>true</optional>
    </dependency>

and XML configuration files from <MongoDb4> to <MongoDb>:

    <NoSql name="MongoDB-Client-Request">
      <MongoDb
        connection="mongodb://localhost:${sys:com.rs.seagull.httpmonitor.etl.MONGODB_PORT:-27017}/${sys:test.API_DB:-HmpDb}.${sys:test.API_CLIENT_REQUEST:-HmpClientRequestEvent}" />
      <MessageLayout />
    </NoSql>

but I still get the warning.

Metadata

Metadata

Assignees

Labels

bugIncorrect, unexpected, or unintended behavior of existing code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions