@loglayer/transport-google-cloud-logging
Version:
Google Cloud Logging (Stackdriver) transport for the LogLayer logging library.
33 lines (32 loc) • 1.38 kB
text/typescript
import { BaseTransport, LogLayerTransportConfig, LogLayerTransportParams } from "@loglayer/transport";
import { Log, LogSync } from "@google-cloud/logging";
import { LogEntry } from "@google-cloud/logging/build/src/entry.js";
//#region src/GoogleCloudLoggingTransport.d.ts
interface GoogleCloudLoggingTransportConfig extends LogLayerTransportConfig<Log | LogSync> {
/**
* The root level data to include for all log entries.
* "severity", "timestamp" and "jsonPayload" are already populated by the transport.
* @see https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry
*/
rootLevelData?: Omit<LogEntry, "severity" | "timestamp" | "receiveTimestamp" | "jsonPayload" | "textPayload" | "protoPayload">;
/**
* List of LogLayer metadata fields to merge into `rootLevelData` when creating the log entry.
*/
rootLevelMetadataFields?: Array<string>;
}
declare class GoogleCloudLoggingTransport extends BaseTransport<Log | LogSync> {
private rootLevelData;
private rootLevelMetadataFields;
constructor(config: GoogleCloudLoggingTransportConfig);
private mapLogLevel;
private extractLogEntryFields;
shipToLogger({
data,
hasData,
logLevel,
messages
}: LogLayerTransportParams): any[];
}
//#endregion
export { GoogleCloudLoggingTransport, type GoogleCloudLoggingTransportConfig };
//# sourceMappingURL=index.d.mts.map