UNPKG

1.63 kBTypeScriptView Raw
1import { ContainerDefinition } from '../container-definition';
2import { BaseLogDriverProps } from './base-log-driver';
3import { LogDriver, LogDriverConfig } from './log-driver';
4import { Construct as CoreConstruct } from '@aws-cdk/core';
5/**
6 * Specifies the json-file log driver configuration options.
7 *
8 * [Source](https://docs.docker.com/config/containers/logging/json-file/)
9 */
10export interface JsonFileLogDriverProps extends BaseLogDriverProps {
11 /**
12 * The maximum size of the log before it is rolled. A positive integer plus a modifier
13 * representing the unit of measure (k, m, or g).
14 *
15 * @default - -1 (unlimited)
16 */
17 readonly maxSize?: string;
18 /**
19 * The maximum number of log files that can be present. If rolling the logs creates
20 * excess files, the oldest file is removed. Only effective when max-size is also set.
21 * A positive integer.
22 *
23 * @default - 1
24 */
25 readonly maxFile?: number;
26 /**
27 * Toggles compression for rotated logs.
28 *
29 * @default - false
30 */
31 readonly compress?: boolean;
32}
33/**
34 * A log driver that sends log information to json-file Logs.
35 */
36export declare class JsonFileLogDriver extends LogDriver {
37 private readonly props;
38 /**
39 * Constructs a new instance of the JsonFileLogDriver class.
40 *
41 * @param props the json-file log driver configuration options.
42 */
43 constructor(props?: JsonFileLogDriverProps);
44 /**
45 * Called when the log driver is configured on a container
46 */
47 bind(_scope: CoreConstruct, _containerDefinition: ContainerDefinition): LogDriverConfig;
48}