File tree 1 file changed +6
-1
lines changed
Sources/AWSLambdaRuntimeCore
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ import NIOCore
23
23
public final class LambdaRuntime < Handler> : @unchecked Sendable where Handler: StreamingLambdaHandler {
24
24
// TODO: We want to change this to Mutex as soon as this doesn't crash the Swift compiler on Linux anymore
25
25
let handlerMutex : NIOLockedValueBox < Handler ? >
26
- let logger : Logger
26
+ var logger : Logger
27
27
let eventLoop : EventLoop
28
28
29
29
public init (
@@ -55,6 +55,11 @@ public final class LambdaRuntime<Handler>: @unchecked Sendable where Handler: St
55
55
throw LambdaRuntimeError ( code: . runtimeCanOnlyBeStartedOnce)
56
56
}
57
57
58
+ // by setting the log level here, we understand it can not be changed dynamically at runtime
59
+ // developers have to wait for AWS Lambda to dispose and recreate a runtime environment to pickup a change
60
+ // this approach is less flexible but more performant than reading the value of the environment variable at each invocation
61
+ self . logger. logLevel = Lambda . env ( " LOG_LEVEL " ) . flatMap ( Logger . Level. init) ?? . info
62
+
58
63
try await LambdaRuntimeClient . withRuntimeClient (
59
64
configuration: . init( ip: ip, port: port) ,
60
65
eventLoop: self . eventLoop,
You can’t perform that action at this time.
0 commit comments