diff --git a/packages/aws-cdk-lib/aws-lambda/lib/function.ts b/packages/aws-cdk-lib/aws-lambda/lib/function.ts index 32e477f81f86b..45c67d9ea3d4b 100644 --- a/packages/aws-cdk-lib/aws-lambda/lib/function.ts +++ b/packages/aws-cdk-lib/aws-lambda/lib/function.ts @@ -1179,7 +1179,7 @@ export class Function extends FunctionBase { } if (props.applicationLogLevel || props.applicationLogLevelV2 || props.systemLogLevel || props.systemLogLevelV2) { - if (props.logFormat !== LoggingFormat.JSON && props.loggingFormat === undefined) { + if (props.logFormat !== LogFormat.JSON && props.loggingFormat === undefined) { throw new Error(`To use ApplicationLogLevel and/or SystemLogLevel you must set LogFormat to '${LogFormat.JSON}', got '${props.logFormat}'.`); }