File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ import type { Format } from "winston" ;
2+
3+ interface Config {
4+ /**
5+ * Whether to convert a logged `err` field to ECS error fields.
6+ * Default true.
7+ */
8+ convertErr ?: boolean ;
9+ /**
10+ * Whether to convert logged `req` and `res` HTTP request and response fields
11+ * to ECS HTTP, User agent, and URL fields. Default false.
12+ */
13+ convertReqRes ?: boolean ;
14+ /**
15+ * Whether to automatically integrate with
16+ * Elastic APM (https://github.com/elastic/apm-agent-nodejs). If a started
17+ * APM agent is detected, then log records will include the following
18+ * fields:
19+ *
20+ * - "service.name" - the configured serviceName in the agent
21+ * - "event.dataset" - set to "$serviceName.log" for correlation in Kibana
22+ * - "trace.id", "transaction.id", and "span.id" - if there is a current
23+ * active trace when the log call is made
24+ *
25+ * Default true.
26+ */
27+ apmIntegration ?: boolean ;
28+ }
29+
30+ export = ( opts ?: Config ) => Format
Original file line number Diff line number Diff line change 33 "version" : " 1.1.0" ,
44 "description" : " A formatter for the winston logger compatible with Elastic Common Schema." ,
55 "main" : " index.js" ,
6+ "types" : " index.d.ts" ,
67 "files" : [
78 " index.js"
89 ],
You can’t perform that action at this time.
0 commit comments