AWS CloudWatch Plugin
The AWS CloudWatch Log plugin enables pushing logs to AWS CloudWatch.
Enterprise Feature
Custom logging is available as an add-on as part of an enterprise plan. If you would like to purchase this feature, please contact us at sales@zuplo.com or reach out to your account manager.
Most enterprise features can be used in a trial mode for a limited time. Feel free to use enterprise features for development and testing purposes.
Setup
To add the AWS CloudWatch logging plugin to your Zuplo project, add the
following code to your zuplo.runtime.ts
file.
modules/zuplo.runtime.tsts
Configuration Options
The AWSLoggingPlugin
constructor accepts an options object with the following properties:
region
- (required) AWS region where your CloudWatch logs are stored (e.g., "us-east-1")accessKeyId
- (required) AWS access key ID for authenticationsecretAccessKey
- (required) AWS secret access key for authenticationlogGroupName
- (required) CloudWatch log group namelogStreamName
- (required) CloudWatch log stream namefields
- (optional) Custom fields to include in each log entry. Can contain string, number, or boolean values
Custom Fields
Any custom fields you want to include in the log entry can be added to the
fields
property. These values will be appended to every log entry.
ts
Default Fields
Every log entry will include the following fields (in camelCase format):
timestamp
- The time the log was created (ISO 8601 format)severity
- The log level (e.g.,ERROR
,INFO
,DEBUG
,WARN
)data
- The log message and any additional dataenvironmentType
- Where the Zuplo API is running. Values areedge
,working-copy
, orlocal
environmentStage
- The deployment stage:working-copy
,preview
, orproduction
requestId
- The UUID of the request (the value of thezp-rid
header)atomicCounter
- An atomic counter used to order logs with identical timestampsrayId
- The network provider identifier (e.g., Cloudflare Ray ID) of the request