serverless-logging-config
v1.0.2
Published
Lets you configure custom log group, JSON logging, and other recent logging changes announce in Nov 2023.
Downloads
13,730
Readme
serverless-logging-config
Lets you configure custom log group, JSON logging, and other recent logging changes announce in Nov 2023.
For more information about these settings, please see the service announcement here
Getting started
- Install as dev dependency:
npm i --save-dev serverless-logging-config
- Add the plugin to the plugins list in your
serverless.yml
:
service: my-service
plugins:
- serverless-logging-config
- Configure the plugin in the
custom
section (you may have to add this to yourserverless.yml
). For example:
service: my-service
custom:
serverless-logging-config:
enableJson: true # [Optional] if enabled, set the LogFormat to JSON
logGroupName: my-logs # [Optional] if set, all functions will send logs this log group
applicationLogLevel: INFO # [Optional] valid values are DEBUG, ERROR, FATAL, INFO, TRACE and WARN
systemLogLevel: INFO # [Optional] valid values are DEBUG, INFO and WARN
useDefaultLogGroup: # [Optional] these functions would keep logging to their default log group
- function1
- function2
See this page for more info on what these settings mean.
IMPORTANT: when used alongside the serverless-iam-roles-per-function
plugin, make sure this plugin is listed AFTER serverless-iam-roles-per-function
. ie.
plugins:
- serverless-iam-roles-per-function
- serverless-logging-config