1 unstable release
new 0.1.0 | Dec 15, 2024 |
---|
#582 in Debugging
59 downloads per month
Used in unftp
24KB
368 lines
An implemention of slog::Drain
for logging to Google Cloud.
Usage
Warning: Currently, this library only works in the context of workload identity.
The slog_google
drain creates log entries compatible with Google Cloud Logging.
Depending on how you want to ship these logs to the Google Logging API, you can choose from one of the available build methods.
Start by configuring the Logger with the builder (Builder
) and selecting the appropriate build method based on your shipping requirements:
build()
: ReceivesWriteLogEntries
over a channel and allows you to handle the transportation manually.build_with_async_shipper()
: Offloads transportation to theShipper
and its sync-async Bridge in an async context. (Requires theshipper
feature.)
The builder
supports several with_*
methods to customize the log message format,
particularly the default labels attached to log entries.
Dependencies
~18–30MB
~460K SLoC