UNPKG

@sap-cloud-sdk/util

Version:

SAP Cloud SDK for JavaScript general utilities

19 lines 646 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.kibana = void 0; const winston_1 = require("winston"); const local_1 = require("./local"); const { combine, timestamp, json, errors } = winston_1.format; /** * Format for logging in Kibana. */ exports.kibana = combine(errors({ stack: true }), timestamp(), (0, winston_1.format)(kibanaTransformer)(), json()); function kibanaTransformer(info) { return { ...info, msg: (0, local_1.getMessageOrStack)(info), written_ts: new Date(info.timestamp).getTime(), written_at: info.timestamp }; } //# sourceMappingURL=kibana.js.map