Skip to content
v2.274.0

LogOptions Struct ​

Defines what execution history events are logged and where they are logged.

Example ​

ts
import * as logs from 'aws-cdk-lib/aws-logs';

const logGroup = new logs.LogGroup(this, 'MyLogGroup');

const definition = sfn.Chain.start(new sfn.Pass(this, 'Pass'));

new sfn.StateMachine(this, 'MyStateMachine', {
  definitionBody: sfn.DefinitionBody.fromChainable(definition),
  logs: {
    destination: logGroup,
    level: sfn.LogLevel.ALL,
  },
});

Properties ​

destinationILogGroupRefdestinationILogGroupRefdestinationILogGroupRefDestinationILogGroupRefDestinationILogGroupRef#
The log group where the execution history events will be logged.

Default: No log group. Required if your log level is not set to OFF.

includeExecutionDatabooleaninclude_execution_databoolincludeExecutionDataBooleanIncludeExecutionDataboolIncludeExecutionData*bool= false#
Determines whether execution data is included in your log.
levelLogLevellevelLogLevellevelLogLevelLevelLogLevelLevelLogLevel= ERROR#
Defines which category of execution history events are logged.