Contentstack LogoContentstack Logo

Log Targets

The Log Target feature in Contentstack Launch enables you to forward logs generated by Launch-hosted SSR Applications, Cloud Functions, and Edge Functions to third-party monitoring services.

When you create a Log Target, you choose which type of logs to forward:

  • Server Logs: Runtime output from your SSR Applications, Cloud Functions, and Edge Functions.
  • Traffic Logs: Request/response metadata from the CDN edge.
You can forward one or both data types per Log Target. This lets you control what each monitoring destination receives.

You can set up an OpenTelemetry Collector service to receive logs through a TLS-secured OTLP (OpenTelemetry Protocol) over gRPC/HTTP endpoint and forward them to your preferred log provider.

OpenTelemetry is an industry-standard framework that simplifies integration with major log provider platforms, ensuring seamless implementation.

Additional Resources:

Tip: You do not need to host your own OpenTelemetry Collector service if your log aggregator platform already supports ingesting logs in OpenTelemetry format over a gRPC/HTTP endpoint.

With this feature, you can integrate forwarded logs with external monitoring tools for real-time insights, alerts, and persistent log storage.

Note: Logs are forwarded exactly as generated by your application. We do not modify, filter, or mask log content. If your logs contain sensitive information, ensure it is masked or removed at the source before export.

This step-by-step guide lets you create Log Targets in Contentstack Launch to forward your project logs to specific endpoints.

Prerequisites

  1. Contentstack account
  2. Access to Launch for your organization
  3. OTEL Collector service capable of receiving logs configured with TLS-secured gRPC/HTTP Endpoint

Steps for Execution

Create a Log Target

To create a Log Target, log in to Contentstack account and follow the steps:

  1. Go to the “App Switcher” icon in the top-right corner and click Launch.
  2. Click the Settings icon and navigate to the Log Targets page.Log-Targets
  3. Click the Create Log Target button to create a new Log Target.Log-Target-Create
  4. In the modal that appears, enter the following:
    • Log Target Name: A name for the Log Target.
    • Data Type: Select one or both log types that the Log Target should forward. At least one is required:
      • Server Logs: Runtime output from SSR Applications, Cloud Functions, and Edge Functions.
      • Traffic Logs: Request/response metadata from the CDN edge.
    • Send Logs For: Select the Launch projects and environments that should send logs to this Log Target. You have two options:
      • All Projects & Environments: Sends logs from all current and future Launch projects and environments in your organization.Launch_Log-Targets_CreateLogTarget1.png

        All Projects & Environments Log Target forwards its selected data types across all current and future environments.
        Only one Log Target can forward each data type organization-wide. The valid setups are:

        • One Log Target forwarding both Server Logs and Traffic Logs.
        • Two Log Targets with one forwarding Server Logs and one forwarding Traffic Logs.
      • Custom: To configure a Log Target for specific projects and environments, select the Custom option. Select your Projects and Environments from the respective dropdowns, then click Apply to configure the settings. Also, click + Add another project to add another set of projects and environments.Log-Target-Send-Logs-For-Custom

        Uniqueness rule

        Each environment and data type combination can be covered by only one Log Target. The same environment can send logs to multiple Log Targets, as long as each uses a different data type.

        Examples:

        • Target A covers env1 with Server Logs, and Target B covers env1 with Traffic Logs. This is allowed because both targets use the same environment but different data types.
        • Target A covers env1 with Server Logs, and Target B covers env1 with Server Logs. This is blocked because the same environment and data type are already covered by another Log Target.
        • Target A covers env1 with Server Logs, and Target B covers env2 with Server Logs. This is allowed because both targets use the same data type but different environments.
        • A Log Target scoped to All Projects & Environments with Server Logs covers Server Logs across every environment. This means no other Log Target can use Server Logs for any environment while this Log Target exists.

        Note: If existing Log Targets cover environments for a selected data type, the system disables the All Projects & Environments option for that data type when creating or editing a Log Target.

    • Delivery Protocol: A protocol (gRPC or HTTP) used to forward logs to the required endpoint.
    • Endpoint URL: The OpenTelemetry OTLP/gRPC/HTTP endpoint where logs are transmitted.
    • Authentication & Headers: Headers required by your provider.
    • Payload Format: The data format (JSON or Protobuf) used to send logs to your provider.

      Note: The JSON option is only for HTTP. If you have selected gRPC as the protocol, the payload format is always Protobuf.

      Log-Target-Continue-Setup
  5. Click the Continue Setup button.
  6. In the modal that appears, perform one of the following:
    • Verify the details and click the Test Connection button.
      If the test is successful, the Log Target is created and configured to forward your project logs to the specified Endpoint URL. If the test fails, an error message appears. You can return to editing and update the Log Target configuration.
    • Click the Save Log Target button to save and verify later.
      If you save the Log Target without testing it first, the system saves it in a disabled state. To enable the Log Target, you must verify it by testing the connection.Launch_Log-Targets_VerifyLogTarget.png
  7. Once verification is successful, click the Enable Log Target button to enable the Log Target and start forwarding logs.Launch_Log-Targets_EnableLogTarget.png

Edit a Log Target

Follow the steps below to edit a Log Target:

  1. Click the Settings icon and navigate to the Log Targets page.
  2. To edit a Log Target, click the vertical ellipses under Actions, and then select Edit.Launch_Log-Targets_SelectEditLogTarget.png
  3. Edit the Log Target details as required and then click the Save Changes button to save the updated details.

    Note: You can change the Data Type during editing. The change is subject to the same environment and data type uniqueness rule. If the selected data type is already covered by another Log Target, including All Projects & Environments Log Targets, the system blocks the change.

    Launch_Log-Targets_EditLogTarget.png

The Log Target is updated while in a disabled state.

Enable Log Target

To enable the Log Target, follow these steps:

  1. Click the toggle next to the Log Target you want to enable.Launch_Log-Targets_ClickDisabled.png
  2. After verifying all the details, click the Test Connection button on the Verify Log Target Connection modal.Launch_Log-Targets_VerifyLogTargetAgain.png
  3. Once the connection is successfully verified, click the Enable Log Target button.

The Log Target is now enabled and ready to forward logs to your provider.

Verify the Connection

To verify the Log Target and test the connection, follow these steps:

  1. Click the Settings icon and navigate to the Log Targets page.
  2. Next to the Log Target you want to verify, click the vertical ellipses under Actions, then select Verify Connection.Launch_Log-Targets_SelectVerify.png
  3. Verify the details, and click the Test Connection button in the Verify Log Target Connection modal.

This confirms whether your Log Target is ready to receive logs.

Note: To verify the connection to your endpoint, Launch sends a test log that may be visible in your observability tool.

Delete a Log Target

Follow the steps below to delete a Log Target:

  1. Click the Settings icon and navigate to the Log Targets page.
  2. To delete the Log Target, click the vertical ellipses under Actions, and then click Delete.Launch_Log-Targets_SelectDelete.png
  3. In the modal that appears, click the Yes, Delete button to delete the Log Target.Launch_LogTargets_DeleteModal.png

Additional Resources: Use this GitHub repository as an example to set up a TLS-secured OTLP/gRPC endpoint that receives and exports logs to CloudWatch.

Limitations

  • You can create a specific number of Log targets. If you want to raise the limit, contact Contentstack support.
  • Launch can forward only up to 1000 logs in a single request.
  • Launch supports a log line size of up to 64 KB per line.
  • Launch supports a total log size of up to 1 MB per request.
Was this article helpful?
^