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

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.

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 declare type Logger = ReturnType