-
Notifications
You must be signed in to change notification settings - Fork 39
/
index.d.ts
54 lines (46 loc) · 1.92 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import type { LoggerOptions } from "pino";
interface Config {
/**
* Whether to convert a logged `err` field to ECS error fields.
* Default true, to match Pino's default of having an `err` serializer.
*/
convertErr?: boolean;
/**
* Whether to convert logged `req` and `res` HTTP request and response fields
* to ECS HTTP, User agent, and URL fields. Default false.
*/
convertReqRes?: boolean;
/**
* Whether to automatically integrate with
* Elastic APM (https://github.com/elastic/apm-agent-nodejs). If a started
* APM agent is detected, then log records will include the following
* fields:
*
* - "trace.id", "transaction.id", and "span.id" - if there is a current
* active trace when the log call is made
*
* and also the following fields, if not already specified in this config:
*
* - "service.name" - the configured `serviceName` in the agent
* - "service.version" - the configured `serviceVersion` in the agent
* - "service.environment" - the configured `environment` in the agent
* - "service.node.name" - the configured `serviceNodeName` in the agent
* - "event.dataset" - set to `${serviceName}` for correlation in Kibana
*
* Default true.
*/
apmIntegration?: boolean;
/** Specify "service.name" field. Defaults to a value from the APM agent, if available. */
serviceName?: string;
/** Specify "service.version" field. Defaults to a value from the APM agent, if available. */
serviceVersion?: string;
/** Specify "service.environment" field. Defaults to a value from the APM agent, if available. */
serviceEnvironment?: string;
/** Specify "service.node.name" field. Defaults to a value from the APM agent, if available. */
serviceNodeName?: string;
/** Specify "event.dataset" field. Defaults `${serviceName}`. */
eventDataset?: string;
}
declare function ecsFormat(config?: Config): LoggerOptions;
export default ecsFormat;
export { ecsFormat }