Amplify Toolbox
    Preparing search index...

    Customizable logging configuration when writing GraphQL operations and tracing to Amazon CloudWatch for an AWS AppSync GraphQL API.

    WARNING: Verbose logging will log the full incoming query including user parameters. Sensitive information may be exposed in CloudWatch logs. Ensure that your IAM policies only grant access to authorized users.

    For information on AppSync's LogConfig, refer to https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-logconfig.html. For information on RetentionDays, refer to https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs.RetentionDays.html.

    excludeVerboseContent: true, fieldLogLevel: 'none', retention: '1 week'
    
    type DataLogConfig = {
        excludeVerboseContent?: boolean;
        fieldLogLevel?: DataLogLevel;
        retention?: LogRetention;
    }
    Index

    Properties

    excludeVerboseContent?: boolean

    When set to true, excludes verbose information from the logs, such as:

    • GraphQL Query
    • Request Headers
    • Response Headers
    • Context
    • Evaluated Mapping Templates

    This setting applies regardless of the specified logging level.

    WARNING: Verbose logging will log the full incoming query including user parameters. Sensitive information may be exposed in CloudWatch logs. Ensure that your IAM policies only grant access to authorized users.

    true
    
    fieldLogLevel?: DataLogLevel

    The field logging level. Values can be 'none', 'error', 'info', 'debug', or 'all'.

    • 'none': No field-level logs are captured.
    • 'error': Logs the following information only for the fields that are in the error category:
      • The error section in the server response.
      • Field-level errors.
      • The generated request/response functions that got resolved for error fields.
    • 'info': Logs the following information only for the fields that are in the info and error categories:
      • Info-level messages.
      • The user messages sent through $util.log.info and console.log.
      • Field-level tracing and mapping logs are not shown.
    • 'debug': Logs the following information only for the fields that are in the debug, info, and error categories:
      • Debug-level messages.
      • The user messages sent through $util.log.info, $util.log.debug, console.log, and console.debug.
      • Field-level tracing and mapping logs are not shown.
    • 'all': The following information is logged for all fields in the query:
      • Field-level tracing information.
      • The generated request/response functions that were resolved for each field.
    'none'
    
    retention?: LogRetention

    The number of days log events are kept in CloudWatch Logs.