1 | import * as logs from '@aws-cdk/aws-logs';
|
2 | import { ContainerDefinition } from '../container-definition';
|
3 | import { LogDriver, LogDriverConfig } from './log-driver';
|
4 | import { Construct as CoreConstruct } from '@aws-cdk/core';
|
5 | /**
|
6 | * awslogs provides two modes for delivering messages from the container to the log driver
|
7 | */
|
8 | export declare enum AwsLogDriverMode {
|
9 | /**
|
10 | * (default) direct, blocking delivery from container to driver.
|
11 | */
|
12 | BLOCKING = "blocking",
|
13 | /**
|
14 | * The non-blocking message delivery mode prevents applications from blocking due to logging back pressure.
|
15 | * Applications are likely to fail in unexpected ways when STDERR or STDOUT streams block.
|
16 | */
|
17 | NON_BLOCKING = "non-blocking"
|
18 | }
|
19 | /**
|
20 | * Specifies the awslogs log driver configuration options.
|
21 | */
|
22 | export interface AwsLogDriverProps {
|
23 | /**
|
24 | * Prefix for the log streams
|
25 | *
|
26 | * The awslogs-stream-prefix option allows you to associate a log stream
|
27 | * with the specified prefix, the container name, and the ID of the Amazon
|
28 | * ECS task to which the container belongs. If you specify a prefix with
|
29 | * this option, then the log stream takes the following format:
|
30 | *
|
31 | * prefix-name/container-name/ecs-task-id
|
32 | */
|
33 | readonly streamPrefix: string;
|
34 | /**
|
35 | * The log group to log to
|
36 | *
|
37 | * @default - A log group is automatically created.
|
38 | */
|
39 | readonly logGroup?: logs.ILogGroup;
|
40 | /**
|
41 | * The number of days log events are kept in CloudWatch Logs when the log
|
42 | * group is automatically created by this construct.
|
43 | *
|
44 | * @default - Logs never expire.
|
45 | */
|
46 | readonly logRetention?: logs.RetentionDays;
|
47 | /**
|
48 | * This option defines a multiline start pattern in Python strftime format.
|
49 | *
|
50 | * A log message consists of a line that matches the pattern and any
|
51 | * following lines that don’t match the pattern. Thus the matched line is
|
52 | * the delimiter between log messages.
|
53 | *
|
54 | * @default - No multiline matching.
|
55 | */
|
56 | readonly datetimeFormat?: string;
|
57 | /**
|
58 | * This option defines a multiline start pattern using a regular expression.
|
59 | *
|
60 | * A log message consists of a line that matches the pattern and any
|
61 | * following lines that don’t match the pattern. Thus the matched line is
|
62 | * the delimiter between log messages.
|
63 | *
|
64 | * This option is ignored if datetimeFormat is also configured.
|
65 | *
|
66 | * @default - No multiline matching.
|
67 | */
|
68 | readonly multilinePattern?: string;
|
69 | /**
|
70 | * The delivery mode of log messages from the container to awslogs.
|
71 | *
|
72 | * @default - AwsLogDriverMode.BLOCKING
|
73 | */
|
74 | readonly mode?: AwsLogDriverMode;
|
75 | }
|
76 | /**
|
77 | * A log driver that sends log information to CloudWatch Logs.
|
78 | */
|
79 | export declare class AwsLogDriver extends LogDriver {
|
80 | private readonly props;
|
81 | /**
|
82 | * The log group to send log streams to.
|
83 | *
|
84 | * Only available after the LogDriver has been bound to a ContainerDefinition.
|
85 | */
|
86 | logGroup?: logs.ILogGroup;
|
87 | /**
|
88 | * Constructs a new instance of the AwsLogDriver class.
|
89 | *
|
90 | * @param props the awslogs log driver configuration options.
|
91 | */
|
92 | constructor(props: AwsLogDriverProps);
|
93 | /**
|
94 | * Called when the log driver is configured on a container
|
95 | */
|
96 | bind(scope: CoreConstruct, containerDefinition: ContainerDefinition): LogDriverConfig;
|
97 | }
|