File tree 1 file changed +12
-0
lines changed
src/main/java/software/amazon/lambda/logging/internal
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 11
11
12
12
import com .amazonaws .services .lambda .runtime .Context ;
13
13
import com .fasterxml .jackson .databind .ObjectMapper ;
14
+ import org .apache .logging .log4j .Level ;
14
15
import org .apache .logging .log4j .LogManager ;
15
16
import org .apache .logging .log4j .Logger ;
16
17
import org .apache .logging .log4j .ThreadContext ;
18
+ import org .apache .logging .log4j .core .LoggerContext ;
19
+ import org .apache .logging .log4j .core .config .Configurator ;
17
20
import org .apache .logging .log4j .core .util .IOUtils ;
18
21
import org .aspectj .lang .ProceedingJoinPoint ;
19
22
import org .aspectj .lang .annotation .Around ;
33
36
@ Aspect
34
37
public final class LambdaLoggingAspect {
35
38
private static final ObjectMapper mapper = new ObjectMapper ();
39
+ private static final String LOG_LEVEL = System .getenv ("LOG_LEVEL" );
40
+
41
+ static {
42
+ if (LOG_LEVEL != null ) {
43
+ LoggerContext ctx = (LoggerContext ) LogManager .getContext (false );
44
+ Configurator .setAllLevels (LogManager .getRootLogger ().getName (), Level .getLevel (LOG_LEVEL ));
45
+ ctx .updateLoggers ();
46
+ }
47
+ }
36
48
37
49
@ SuppressWarnings ({"EmptyMethod" , "unused" })
38
50
@ Pointcut ("@annotation(powerToolsLogging)" )
You can’t perform that action at this time.
0 commit comments