title: How to restrict unwanted logs from Cloudwatch while using AWS Lambda?
body: <p>I have a lambda function that reads file from S3 bucket and stores it to another S3 bucket. The lambda is working fine, but when I see the cloudwatch for logs, I see additional logs which is not needed. </p>
  
  <p>The additional logs that I get are like below.,</p>
  
  <pre><code>[main] DEBUG org.springframework.context.annotation.AnnotationConfigApplicationContext 
  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory
  [main] DEBUG com.amazonaws.AmazonWebServiceClient
  [main] DEBUG org.apache.http.headers
  [main] DEBUG org.apache.http.wire
  </code></pre>
  
  <p>I want to display only the <code>logger.info()</code> used inside the code to be displayed in cloudwatch. Is there any way to restrict those logs from getting displayed ? Can someone provide an example code for reference ?</p>
  
  <p>I am setting log4j.properties file, with the below content. </p>
  
  <pre><code>log4j.rootLogger=INFO
  log4j.appender.A1=org.apache.log4j.ConsoleAppender
  log4j.appender.A1.layout=org.apache.log4j.PatternLayout
  log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c -  %m%n
  # Log all HTTP content (headers, parameters, content, etc)  for
  # all requests and responses. Use caution with this since it can
  # be very expensive to log such verbose data!
  log4j.logger.org.apache.http.wire=INFO
  </code></pre>