dynamodb local: ERROR StatusLogger Log4j2 could not find a logging implementation
Asked Answered
F

4

16

This is the first time that this issue has occurred to me, I have used DynamoDB local on Linux and Mac and most of the time it worked fine, and now I'm on a different Mac machine, it just throws an error.

The error message that I got was:

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

I tried installing it via homebrew, but it's throwing the same error. I may have messed up something in my machine or may have missed some configuration.

Below is the screenshot from when I have tried to run it:

enter image description here

Reference:
Dynamo DB Local: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html

Fruitful answered 27/10, 2020 at 6:8 Comment(0)
I
9

According to this AWS Support Forum response by an AWS person this problem doesn't affect the working of the DynamoDB local instance.

They do intend to fix it so that the messages isn't displayed but it doesn't make a functional difference.

I haven't yet managed to make my local instance work but there may be other, un-associated, issues with that.

enter image description here

Iphigenia answered 7/11, 2020 at 8:56 Comment(1)
This should be top answer imo. In my haste, I only read the first two sentences. The last indicates it's using a fallback so there really isn't any usage issues. I really with they would have used the log level of WARNING instead of ERROR in this output.Hebe
G
4

How I got this to work is to do the following:

Extract the contents of the jar file to a seperate folder

jar xf DynamoDBLocal_Orig.jar

Add the following to the pom.xml

<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-to-slf4j</artifactId>
    <version>${log4j.version}</version>
</dependency

Edit the META-INF/MANIFEST.MF file and add

DynamoDBLocal_lib/log4j-core-2.13.3.jar

Compress to a new jar

jar cmvf META-INF/MANIFEST.MF DynamoDBLocal.jar *

Rename DynamoDBLocal.jar from the base folder to DynamoDBLocal_old.jar

Move the newly created DynamoDBLocal.jar to the base folder.

Download the log4j-core-2.13.3.jar from https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core/2.13.3

Place the log4j-core-2.13.3.jar inside the DynamoDBLocal_lib folder

Run

java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
Gerah answered 5/11, 2020 at 4:57 Comment(1)
This is the most tedious solution so far but this one works best. Thanks!Fruitful
M
3

It seems like zip versions are corrupted. You can download .rar file, it will work. .rar has log4j-core-2.8.jar along with Log4j-api-2.x.jar inside the DynamoDBLocal_lib folder and it is working for me.

Mistassini answered 29/10, 2020 at 13:25 Comment(2)
I'd say they got a FUBAR situation at Amazon. I download the .zip and .tar versions and I'm getting those errors. Even the amazon/dynamodb-local docker has that same error.Theravada
Can confirm this is happening using the amazon/dynamodb-local docker on a fresh install done at 7-Nov-2020 08:30 UTC.Iphigenia
M
3

I just had exactly the same problem. I tried both the tar and the zip file from Europe (frankfurt) region. The problem persisted. I can see the log4j-core package in the classpath, but somehow it doesn't get picked up. Not sure if the other AWS regions are corrupted too.

I solved it by asking a colleague of mine to share his DynamoDB folder. He downloaded it a few months ago, and it's working like a charm.

Solution: AWS needs to fix the package, otherwise see if you can ask a colleague to help you out.

Mcfarlane answered 29/10, 2020 at 13:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.