# Class StructuredJsonSink

Serialises each audit entry to JSON and passes it to a writer callback.

Suitable for forwarding to structured log aggregators such as AWS CloudWatch, Elasticsearch, or Splunk.

#### Example

    const sink = new StructuredJsonSink((json) => cloudwatch.putLogEvent(json));
    const logger = new AuditLogger({ sinks: [sink] });

#### Since

0.9.0

#### Implements

- AuditSink

- Defined in utils/auditSink.ts:351

##### Index

### Constructors

constructor

### Properties

writer

### Methods

write

## Constructors

### constructor

- new StructuredJsonSink(writer?: (json: string) => void): StructuredJsonSink

  #### Parameters

  - `Optional` writer: (json: string) => void

  #### Returns StructuredJsonSink

  - Defined in utils/auditSink.ts:354

## Properties

### `Private` `Readonly` writer

writer: (json: string) => void

- Defined in utils/auditSink.ts:352

## Methods

### write

- write(entry: AuditLogEntry): void

  Write a single audit entry to the sink

  #### Parameters

  - entry: AuditLogEntry

  #### Returns void

  Implementation of AuditSink.write

  - Defined in utils/auditSink.ts:360