Debug and Troubleshoot Logs with Vercel and Sematext

Automatically send all Vercel logs to Sematext to understand how your application is running.

Sematext is a full-stack observability tool that helps developers keep track of logs, metrics, infrastructure, and website performance.

This guide walks you through setting up a log drain for your Vercel deployments. The log drain will automatically send logs to Sematext where you can debug and troubleshoot issues with full-text search, filtering, tagging, and custom charts for your Vercel logs.

Step 1: Import and Deploy with Vercel

To deploy your project with a Vercel for Git Integration, make sure it has been pushed to a Git repository.

Import the project into Vercel using your Git Integration of choice:

After your project has been imported, all subsequent pushes to branches will generate Preview Deployments, and all changes made to the default branch (commonly "master") will result in a Production Deployment.

Step 2: Install the Sematext Logs Vercel Integration

With your project set up with Vercel, install the Sematext Logs integration from the Vercel Integrations Marketplace to add it to your account.

Add the Sematext Logs integration.

Select the account or team your deployed project belongs to. You will then be redirected to Sematext Logs.

Grant the Sematext Logs integration access to the account that your project belongs to.

Step 3: Set Up a Sematext Account

If you do not have a Sematext account already, click Start Free Trial on Sematext to sign up. Otherwise, you can continue with your existing account.

Set up a Sematext Account.

Step 4: Create a Logs App

When logged in to Sematext, select Start Shipping Logs. This will set up a Logs App that acts as container for your data.

Create a Logs App.

The Logs App will show you a token you need to add to the Sematext Logs Vercel Integration.

Save the token somewhere safe.

Step 5: Create a Sematext Log Drain

Open your Sematext Logs integration, select the region in which you created your Sematext Account, and add the token from Step 4. Finally, save the log drain.

Set up the Sematext Log Drain.

Note: It may take a few seconds for logs to come in.

By default, you get a set of reports out of the box, with default alert rules to notify you for common errors and timeouts.

Sematext Logs reports showing logs data.

These include structured formats for Lambda functions, including errors, timeouts, and cold starts.

Step 6: Forwarding Vercel Logs to Multiple Sematext Logs Apps (Optional)

When configuring the Sematext Logs Vercel Integration you can configure whether to collect logs from all projects or just a few. With this integration you can configure multiple log drains that point to multiple destinations. This means you can specify which project will send logs to which Sematext Logs App.

To configure multiple log drains, create multiple Logs Apps in Sematext and multiple Log Drains in the Sematext Logs Vercel Integration.

Once added, you'll see an overview of all the Log Drains you have configured.

Multiple Log Drains.

Conclusion

This guide shows how to set up a Sematext Log Drain for your Vercel deployments. The log drain will automatically send logs to Sematext where you can debug and troubleshoot issues with full-text search, filtering, tagging, and custom charts for your Vercel logs.



Written By
Written by adnanrahicadnanrahic