We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7110b67 commit 8bfd2d6Copy full SHA for 8bfd2d6
1 file changed
packages/aws-cdk-lib/aws-lambda/lib/function.ts
@@ -1085,6 +1085,9 @@ export class Function extends FunctionBase {
1085
* function and undefined if not.
1086
*/
1087
private getLoggingConfig(props: FunctionProps): CfnFunction.LoggingConfigProperty | undefined {
1088
+ if (props.logFormat !== undefined && !Object.values(LogFormat).includes(props.logFormat as LogFormat)) {
1089
+ throw new TypeError(`'${props.logFormat}' is not a legal LogFormat type.`);
1090
+ }
1091
if ((props.applicationLogLevel || props.systemLogLevel) && props.logFormat !== LogFormat.JSON) {
1092
throw new Error(`To use ApplicationLogLevel and/or SystemLogLevel you must set LogFormat to '${LogFormat.JSON}', got '${props.logFormat}'.`);
1093
}
0 commit comments