I have AWS Lambdas coded using Java8. I am using Log4j1.2.17 for logging needs:
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
The logging configuration is specified using log4.properties file as follows:
# Root logger option
log4j.rootLogger=INFO, stdout
# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
As you can see currently the log level is set to "info". i want to change log level using the AWS Lambda environment variables such that if Debug is needed, set some Lambda environment variable and it should be reflected in Lambda function so that it starts logging in Debug statements. Any help will be appreciated. Thanks