5

I’m building a Java project that’s running in AWS lambda. I’m relatively new to working with AWS and am working with a project that uses org.eclipse.rdf4j libraries.

The libraries do a good deal of DEBUG logging when connecting with a database, for example:


13:47:38.363 [main] DEBUG o.e.r.rio.DatatypeHandlerRegistry - Registered service class org.eclipse.rdf4j.rio.datatypes.XMLSchemaDatatypeHandler
13:47:38.367 [main] DEBUG o.e.r.rio.DatatypeHandlerRegistry - Registered service class org.eclipse.rdf4j.rio.datatypes.RDFDatatypeHandler
13:47:38.368 [main] DEBUG o.e.r.rio.DatatypeHandlerRegistry - Registered service class org.eclipse.rdf4j.rio.datatypes.DBPediaDatatypeHandler

and


13:47:38.552 [main] DEBUG org.apache.http.wire - http-outgoing-0 "HTTP/1.1 200 [\r][\n]"
13:47:38.552 [main] DEBUG org.apache.http.wire - http-outgoing-0 "Vary: Accept-Encoding[\r][\n]"
13:47:38.552 [main] DEBUG org.apache.http.wire - http-outgoing-0 "Content-Type: text/plain;charset=UTF-8[\r][\n]"
13:47:38.552 [main] DEBUG org.apache.http.wire - http-outgoing-0 "Content-Language: en-US[\r][\n]"
13:47:38.552 [main] DEBUG org.apache.http.wire - http-outgoing-0 "Content-Length: 1[\r][\n]"

I have added a logback.xml file to src/main/resources which looks like this:

<configuration>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <!-- encoders are assigned the type
         ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
    <encoder>
        <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    </encoder>
</appender>

<root level="error">
    <appender-ref ref="STDOUT" />
</root>

This is from an example project that came with various code examples.

When I run locally in eclipse, this works perfectly and I don’t see the debug logging.

However, when I run on AWS, I still see this logging in the CloudWatch logs.

How can I get AWS lambda to recognized these logback settings? Or is there something altogether different I need to do?

Thanks very much for any pointers!

Wubak
  • 61
  • 4
  • Possible duplicate of https://stackoverflow.com/a/46494684/5030709. See if the answers provided helps for you. – Imran Aug 09 '18 at 02:53

0 Answers0