File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,11 @@ public final class LambdaRuntime<Handler>: @unchecked Sendable where Handler: St
46
46
// developers have to wait for AWS Lambda to dispose and recreate a runtime environment to pickup a change
47
47
// this approach is less flexible but more performant than reading the value of the environment variable at each invocation
48
48
var log = logger
49
- log. logLevel = Lambda . env ( " LOG_LEVEL " ) . flatMap ( Logger . Level. init) ?? . info
49
+
50
+ // use the LOG_LEVEL environment variable to set the log level.
51
+ // if the environment variable is not set, use the default log level from the logger provided
52
+ log. logLevel = Lambda . env ( " LOG_LEVEL " ) . flatMap ( Logger . Level. init) ?? logger. logLevel
53
+
50
54
self . logger = log
51
55
self . logger. debug ( " LambdaRuntime initialized " )
52
56
}
You can’t perform that action at this time.
0 commit comments