Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 957
yakovmeister Avatar asked Oct 27 '20 06:10

yakovmeister


2 Answers

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

like image 130
glaucon Avatar answered Sep 24 '22 03:09

glaucon


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
like image 20
Jose Hernandez Avatar answered Sep 20 '22 03:09

Jose Hernandez