Reputation: 5143
More than often DynamoDB Local does not show descriptive error messages, in order to see internal errors you need to enable logging.
What are the steps to enable DynamoDB Local logging on the standard output?
Upvotes: 17
Views: 9823
Reputation: 441
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="com.amazonaws.services.dynamodbv2.local" level="DEBUG">
<AppenderRef ref="Console"/>
</Logger>
<Logger name="com.amazonaws.services.dynamodbv2.local.shared.access.sqlite.SQLiteDBAccess" level="INFO">
<AppenderRef ref="Console"/>
</Logger>
<Root level="WARN">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
zip -d DynamoDBLocal.jar log4j2.xml
zip -u DynamoDBLocal.jar log4j2.xml
or simply edit the log4j2.xml in the DynamoDBLocal.jar using 7-Zip etc. and overwrite it with the xml above and skip the steps 2-4.
Upvotes: 17
Reputation: 5143
Create a new file called log4j.properties with the contents:
log4j.rootLogger=DEBUG, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=LOG%d %p [%c] - %m%n
Remove the existing log4j.properties files from the jar (there might be two)
zip -d DynamoDBLocal.jar log4j.properties
zip -d DynamoDBLocal.jar log4j.properties
Add the new properties file to the jar
zip -u DynamoDBLocal.jar log4j.properties
Source: https://gist.github.com/mdaley/aaf9b62d90f6817eb72a
Upvotes: 1