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
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]".
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Package @google-cloud/logging-bunyan (5.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.1.0 (latest)](/nodejs/docs/reference/logging-bunyan/latest/overview)\n- [5.0.1](/nodejs/docs/reference/logging-bunyan/5.0.1/overview)\n- [4.2.1](/nodejs/docs/reference/logging-bunyan/4.2.1/overview)\n- [4.1.5](/nodejs/docs/reference/logging-bunyan/4.1.5/overview)\n- [3.3.0](/nodejs/docs/reference/logging-bunyan/3.3.0/overview)\n- [3.2.2](/nodejs/docs/reference/logging-bunyan/3.2.2/overview)\n- [3.1.1](/nodejs/docs/reference/logging-bunyan/3.1.1/overview)\n- [3.0.2](/nodejs/docs/reference/logging-bunyan/3.0.2/overview) \n\nClasses\n-------\n\n### [LoggingBunyan](/nodejs/docs/reference/logging-bunyan/latest/logging-bunyan/loggingbunyan)\n\nThis module provides support for streaming your Bunyan logs to \\[Stackdriver Logging\\](\u003chttps://cloud.google.com/logging\u003e).\n\nInterfaces\n----------\n\n### [express.MiddlewareOptions](/nodejs/docs/reference/logging-bunyan/latest/logging-bunyan/express.middlewareoptions)\n\n### [express.MiddlewareReturnType](/nodejs/docs/reference/logging-bunyan/latest/logging-bunyan/express.middlewarereturntype)\n\nVariables\n---------\n\n### express.APP_LOG_SUFFIX\n\n APP_LOG_SUFFIX = \"applog\"\n\n### LOGGING_SAMPLED_KEY\n\n LOGGING_SAMPLED_KEY = \"logging.googleapis.com/trace_sampled\"\n\nKey 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. \n\n### LOGGING_SPAN_KEY\n\n LOGGING_SPAN_KEY = \"logging.googleapis.com/spanId\"\n\nKey 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. \n\n### LOGGING_TRACE_KEY\n\n LOGGING_TRACE_KEY = \"logging.googleapis.com/trace\"\n\nKey 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. \n\n### NODEJS_BUNYAN_DEFAULT_LIBRARY_VERSION\n\n NODEJS_BUNYAN_DEFAULT_LIBRARY_VERSION = \"5.1.0\"\n\nDefault 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 \n\nFunctions\n---------\n\n### express.middleware(options)\n\n export declare function middleware(options?: MiddlewareOptions): Promise\n\nExpress middleware \n\n### getCurrentTraceFromAgent()\n\n export declare function getCurrentTraceFromAgent(): string | null;\n\nGets 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\\]\". \n\nType Aliases\n------------\n\n### express.Logger\n\n export type Logger = ReturnType"]]