Disable INFO logging from AWS Java SDK
We’re using the AWS Java SDK and had an incredibly difficult time figuring out how to disable INFO-level logging.
This is probably particular to our configuration, but I think it is a fairly common setup: Jetty on Ubuntu on EC2.
The problem is that Jetty uses SLF4J, and includes the default slf4j-simple.jar which logs everything. In order to fix it, you have to remove the symlink in /usr/share/jetty/lib/jsp2.1 and create a new symlink to slf4j-jdk14.jar (and the configure java logging to not log at INFO).
Step by step:
- cd /usr/share/jetty/lib/jsp2.1
- sudo rm slf4j-simple.jar
- sudo ln -s ../../../java/slf4j-jdk14.jar slf4j-jdk14.jar
- create /usr/share/jetty/webapps/root/WEB-INF/logging.properties with
.level=WARNING - cd /etc/defaults
- edit jetty and add:
JAVA_OPTIONS=-Djava.util.logging.config.file=/usr/share/jetty/webapps/root/WEB-INF/logging.properties
Advertisement