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.
The additional logs that I get are like below.,
[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
I want to display only the logger.info()
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 ?
I am setting log4j.properties file, with the below content.
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