VMWare Log Insight Log Plugin
The VMWare Log Insight plugin enables pushing logs to your VMWare Log Insights via the REST API.
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 VMWare Log Insight logging plugin to your Zuplo project, add the
following code to your zuplo.runtime.ts
file.
modules/zuplo.runtime.tsts
Configuration Options
The VMWareLogInsightLoggingPlugin
constructor accepts an options object with
the following properties:
url
- (required) The URL of your VMWare Log Insight host (e.g.,https://loginsight.example.com
)agentId
- (optional) The unique agent identifier of the loggerfields
- (optional) Custom fields to include in each log entry. Can contain string, number, or boolean valuestextReplacements
- (optional) An array of string tuples to replace within the text field of a log entryonMessageSending
- (optional) A callback function to modify log entries before sending
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.
Text Replacements
The textReplacements
option allows you to specify character replacements in
the log text. For example: [["'", ""], ['"', ""], ["\\n", ""], [":", "="]]
Default Fields
Every log entry will have a timestamp
and a text
field. The text field
contains the log message, which may be JSON encoded for complex data.
Default fields are (in snake_case format):
severity
- The log level (e.g.,ERROR
,INFO
,DEBUG
,WARN
)request_id
- The UUID of the request (the value of thezp-rid
header)environment_type
- Where the Zuplo API is running. Values areedge
,working-copy
, orlocal
environment_stage
- The deployment stage:working-copy
,preview
, orproduction
log_source
- The source of the log. Eitheruser
orsystem
atomic_counter
- An atomic counter used to order logs with identical timestampsenvironment
- The environment name of the Zuplo APIrequest_ray_id
- The network provider identifier (e.g., Cloudflare Ray ID) of the request
VMWare Log Insight uses snake_case naming convention for field names.
Log Format
The shape of the logs sent from Zuplo will be in the following format:
json
Example Logs
When objects are logged, they will be converted to a key value string format as shown below.
json
Errors will be included as fields in the log. The fields are error_name
,
error_message
, and error_stack
.
json