New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(AWS Lambda): Support loggingConfig
#12315
base: main
Are you sure you want to change the base?
Conversation
} | ||
|
||
if (functionObject.loggingConfig.logGroup) { | ||
loggingConfig.LogGroup = functionObject.loggingConfig.logGroup; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, Serverless also provisions the Log Group itself as part of it's cloudformation stack. At that stage, the custom log group name also needs to be checked.
functionResource.Properties.LoggingConfig = loggingConfig; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be more compact as:
if (functionObject.loggingConfig) {
const loggingConfig = {};
({
ApplicationLogLevel: loggingConfig.applicationLogLevel,
LogFormat: loggingConfig.logFormat,
LogGroup: loggingConfig.logGroup,
SystemLogLevel: loggingConfig.systemLogLevel,
} = functionObject.loggingConfig);
functionResource.Properties.LoggingConfig = Object.keys(loggingConfig).length ? loggingConfig : undefined;
}
would this also allow to set this config at a global level so it's applied to all lambdas? |
Closes: #12264