Serverless Framework plugin to configure Lambda logging settings
npm install serverless-configure-lambda-logsA Serverless Framework plugin (compatible with version 3.40.0 and earlier) to configure AWS Lambda logging options.
``bashNPM
npm install --save-dev serverless-configure-lambda-logs
Local Development
If you want to develop or test this plugin locally:
1. Clone this repository
2. Install it locally in your project:
`bash
In your Serverless project directory
npm install --save-dev /path/to/serverless-configure-lambda-logs
`Usage
Add the plugin to your
serverless.yml file:`yaml
plugins:
- serverless-configure-lambda-logs
`$3
Configure log options globally for all functions:
`yaml
custom:
logs:
format: json # 'json' or 'text' (default is 'text')
applicationLevel: INFO # 'TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL' (default is 'ERROR')
systemLevel: INFO # 'DEBUG', 'INFO', 'WARN' (default is 'WARN')
logGroup: /custom/log/group/path # Optional: specify a custom log group
`$3
Configure log options individually for each function:
`yaml
functions:
hello:
handler: handler.hello
logs:
format: json
applicationLevel: DEBUG
systemLevel: DEBUG
logGroup: /custom/log/group/path
``- Log configuration options with automatic CloudFormation injection
- Support for text and JSON log formats
- Configurable log levels
- Updates configurations via AWS SDK
- Support for custom log groups
- NEW in 1.0.7: Compatibility with serverless-plugin-split-stacks
This project is licensed under the MIT License - see the LICENSE file for details.