Package @google-cloud/logging-bunyan (5.1.0)

Classes

LoggingBunyan

This module provides support for streaming your Bunyan logs to [Stackdriver Logging](https://cloud.google.com/logging).

Interfaces

express.MiddlewareOptions

express.MiddlewareReturnType

Variables

express.APP_LOG_SUFFIX

APP_LOG_SUFFIX = "applog"

LOGGING_SAMPLED_KEY

LOGGING_SAMPLED_KEY = "logging.googleapis.com/trace_sampled"

Key to use in the Bunyan payload to allow users to indicate a traceSampled flag for the request, and to store as an intermediate value on the log entry before it gets written to the Cloud logging API.

LOGGING_SPAN_KEY

LOGGING_SPAN_KEY = "logging.googleapis.com/spanId"

Key to use in the Bunyan payload to allow users to indicate a spanId for the request, and to store as an intermediate value on the log entry before it gets written to the Cloud logging API.

LOGGING_TRACE_KEY

LOGGING_TRACE_KEY = "logging.googleapis.com/trace"

Key to use in the Bunyan payload to allow users to indicate a trace for the request, and to store as an intermediate value on the log entry before it gets written to the Cloud Logging logging API.

NODEJS_BUNYAN_DEFAULT_LIBRARY_VERSION

NODEJS_BUNYAN_DEFAULT_LIBRARY_VERSION = "5.1.0"

Default library version to be used Using release-please annotations to update DEFAULT_INSTRUMENTATION_VERSION with latest version. See https://github.com/googleapis/release-please/blob/main/docs/customizing.md#updating-arbitrary-files

Functions

express.middleware(options)

export declare function middleware(options?: MiddlewareOptions): Promise

Express middleware

Parameter
NameDescription
optionsMiddlewareOptions
Returns
TypeDescription
Promise<MiddlewareReturnType>

getCurrentTraceFromAgent()

export declare function getCurrentTraceFromAgent(): string | null;

Gets the current fully qualified trace ID when available from the @google-cloud/trace-agent library in the LogEntry.trace field format of: "projects/[PROJECT-ID]/traces/[TRACE-ID]".

Returns
TypeDescription
string | null

Type Aliases

express.Logger

export type Logger = ReturnType