Show / Hide Table of Contents

Enum LoggingFormat

This field takes in 2 values either Text or JSON.

Namespace: Amazon.CDK.AWS.Lambda
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public enum LoggingFormat
Syntax (vb)
Public Enum LoggingFormat
Remarks

By setting this value to Text, will result in the current structure of logs format, whereas, by setting this value to JSON, Lambda will print the logs as Structured JSON Logs, with the corresponding timestamp and log level of each event. Selecting ‘JSON’ format will only allow customers to have different log level Application log level and the System log level.

ExampleMetadata: infused

Examples
using Amazon.CDK.AWS.Logs;

             ILogGroup logGroup;


             new Function(this, "Lambda", new FunctionProps {
                 Code = new InlineCode("foo"),
                 Handler = "index.handler",
                 Runtime = Runtime.NODEJS_18_X,
                 LoggingFormat = LoggingFormat.JSON,
                 SystemLogLevelV2 = SystemLogLevel.INFO,
                 ApplicationLogLevelV2 = ApplicationLogLevel.INFO,
                 LogGroup = logGroup
             });

Synopsis

Fields

JSON

Lambda structured logging in Json format.

TEXT

Lambda Logs text format.

Fields

Name Description
JSON

Lambda structured logging in Json format.

TEXT

Lambda Logs text format.

Back to top Generated by DocFX