File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ import type { LoggerOptions } from "pino" ;
2+
3+ interface Config {
4+ /**
5+ * Whether to convert a logged `err` field to ECS error fields.
6+ * Default true, to match Pino's default of having an `err` serializer.
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+ declare function createEcsPinoOptions ( config ?: Config ) : LoggerOptions ;
31+
32+ export = createEcsPinoOptions ;
Original file line number Diff line number Diff line change 66 "files" : [
77 " index.js"
88 ],
9+ "types" : " index.d.ts" ,
910 "repository" : {
1011 "type" : " git" ,
1112 "url" : " git+https://github.com/elastic/ecs-logging-nodejs.git"
3738 "@elastic/ecs-helpers" : " ^1.1.0"
3839 },
3940 "devDependencies" : {
41+ "@types/pino" : " ^6.3.9" ,
4042 "ajv" : " ^7.0.3" ,
4143 "ajv-formats" : " ^1.5.1" ,
4244 "elastic-apm-node" : " ^3.14.0" ,
You can’t perform that action at this time.
0 commit comments