# Local logging

This document describes how integration execution logs are saved in Application Integration and how to enable local logging for your integrations.

## Overview

Local logging refers to the integration's data or metadata that is saved during its execution. Application Integration
uses the saved data to generate the [integration execution logs](https://docs.cloud.google.com/application-integration/docs/integration-execution-logs).

You can set the **Local logging** to any of the following three modes:

- **Enable(sync):** The log data is persisted (written) during integration's execution. In this mode, Application Integration writes the log data synchronously after each execution step. This mode guarantees the generation of logs for all the integration executions.

  Use this mode if your priority is to have a guaranteed generation of logs, and a latency in
  integration execution time is acceptable.
- **Enable(async):** By default, local logging for an integration is enabled in async mode. The log data is persisted (written) at fixed intervals or after the completion of the integration's execution, whichever is earlier. In this mode, the integration takes a relatively lesser time to execute when compared to `Enable(sync)` mode, because Application Integration writes the log data asynchronously during the integration execution. However, this mode doesn't guarantee the generation of logs for all the executions. In rare cases, it's possible that logs aren't generated for an integration execution.

  Use this mode if your priority is to run your integrations with reduced latency, and the guaranteed
  generation of logs is relatively of a lesser importance.
- **Disable:** The execution logs aren't generated for the integration. Disabling the local logging improves the overall integration latency, as log events aren't generated for request and response parameters, and other integration variables.

## Configure local logging

To configure the local logging for your integration, do the following steps:

1. Open your integration in the [integration editor](https://docs.cloud.google.com/application-integration/docs/integrations-ui-layout).
2. In the toolbar, click **Integration settings**.
3. From the **Local logging** list, select the [local logging mode](https://docs.cloud.google.com/application-integration/docs/local-logging#overview). By default, **Local logging** is set to **Enable(async)**.
![image showing local logging options](https://docs.cloud.google.com/static/application-integration/images/dbp_options.png) ![image showing local logging options](https://docs.cloud.google.com/static/application-integration/images/dbp_options.png)
4. Click **Done**.

> [!TIP]
> **Tip:**Disabling the local logging improves the overall integration latency, as log events aren't generated for request and response parameters, and other integration variables.

## Retention period

The retention period for integration execution logs is 32 days. If you want to modify the retention period, you must enable Cloud Logging and configure the retention period for your project. For more information, see [Logging retention](https://docs.cloud.google.com/logging/docs/routing/overview#logs-retention).

## Quotas and limits

For information about quotas and limits, see [Quotas and limits](https://docs.cloud.google.com/application-integration/docs/quotas).

## What's next

- Learn about [all tasks and triggers](https://docs.cloud.google.com/application-integration/docs/all-triggers-tasks).
- Learn how to [test and publish an integration](https://docs.cloud.google.com/application-integration/docs/test-publish-integrations).

- Learn about [error handling](https://docs.cloud.google.com/application-integration/docs/error-handling-strategy).
- Learn about [integration execution logs](https://docs.cloud.google.com/application-integration/docs/introduction-logs).