1 unstable release

new 0.1.0 Dec 15, 2024

#582 in Debugging

Download history 59/week @ 2024-12-09

59 downloads per month
Used in unftp

Apache-2.0

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:

  1. build(): Receives WriteLogEntries over a channel and allows you to handle the transportation manually.
  2. build_with_async_shipper(): Offloads transportation to the Shipper and its sync-async Bridge in an async context. (Requires the shipper 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