Class LoggingFormat
This field takes in 2 values either Text or JSON.
Inheritance
System.Object
LoggingFormat
Namespace: Amazon.CDK.AWS.Lambda
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public sealed class LoggingFormat : Enum
Syntax (vb)
Public NotInheritable Class LoggingFormat
Inherits
Enum
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. |
value__ |
Fields
JSON
Lambda structured logging in Json format.
public const LoggingFormat JSON
Field Value
Type | Description |
---|---|
LoggingFormat |
TEXT
value__
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |