mirror of
https://github.com/serverless/serverless.git
synced 2026-02-01 16:07:28 +00:00
docs: Add logging configuration docs (#12390)
This commit is contained in:
parent
acb5701f4f
commit
97bdcf5f05
@ -522,6 +522,16 @@ Configure logs for the deployed resources:
|
||||
```yml
|
||||
provider:
|
||||
logs:
|
||||
# Optional Configuration of Lambda Logging Configuration
|
||||
lambda:
|
||||
# The Log Format to be used for all lambda functions (default: Text)
|
||||
logFormat: JSON
|
||||
# The Application Log Level to be used, This can only be set if `logFormat` is set to `JSON`
|
||||
applicationLogLevel: ERROR
|
||||
# The System Log Level to be used, This can only be set if `logFormat` is set to `JSON`
|
||||
systemLogLevel: INFO
|
||||
# The LogGroup that will be used by default. If this is set the Framework will not create LogGroups for any functions
|
||||
LogGroup: /aws/lambda/global-log-group
|
||||
# Enable HTTP API logs
|
||||
# This can either be set to `httpApi: true` to use defaults, or configured via subproperties
|
||||
# Can only be configured if the API is created by Serverless Framework
|
||||
@ -656,6 +666,16 @@ functions:
|
||||
disableLogs: false
|
||||
# Duration for CloudWatch log retention (default: forever). Overrides provider setting.
|
||||
logRetentionInDays: 14
|
||||
# Optional Configuration of Lambda Logging Configuration, if this is also set at the provider level, then a given functions configuration will take priority.
|
||||
logs:
|
||||
# The Log Format to be used for all lambda functions (default: Text)
|
||||
logFormat: JSON
|
||||
# The Application Log Level to be used, This can only be set if `logFormat` is set to `JSON`
|
||||
applicationLogLevel: ERROR
|
||||
# The System Log Level to be used, This can only be set if `logFormat` is set to `JSON`
|
||||
systemLogLevel: INFO
|
||||
# The LogGroup that will be used by default. If this is set the Framework will not create LogGroups for any functions
|
||||
LogGroup: /aws/lambda/global-log-group
|
||||
tags: # Function specific tags
|
||||
foo: bar
|
||||
# VPC settings for this function
|
||||
|
||||
@ -724,7 +724,7 @@ class AwsProvider {
|
||||
type: 'string',
|
||||
enum: ['DEBUG', 'ERROR', 'FATAL', 'INFO', 'TRACE', 'WARN']
|
||||
},
|
||||
logFormat: { type: 'string', enum: ['JSON', 'TRACE']},
|
||||
logFormat: { type: 'string', enum: ['JSON', 'Text']},
|
||||
logGroup: { type: 'string', pattern: '[\\.\\-_/#A-Za-z0-9]+', minLength: 1, maxLength: 512},
|
||||
systemLogLevel: { type: 'string', enum: ['DEBUG', 'INFO', 'WARN'] }
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user