Home ci 39. log-drains: log drains

39. log-drains: log drains

Last updated on Aug 05, 2025

To set up a Next.js application to receive logs from Epycbyte using Log Drains, follow these organized steps:

  1. Integrate the Secret: Ensure your Next.js app has an INTEGRATION_SECRET environment variable. This is crucial for signature verification.

  2. Configure Routes: Place the provided code in an API route handler within your Next.js app, typically in /pages/api or under /app.

  3. Log Drain Configuration:

    • Sources: On Epycbyte, specify which sources you want to monitor (e.g., "lambda" for API routes).
    • Environments: Select the environments relevant to your deployment (e.g., "production").
  4. Sampling Rate: Optionally set a sampling rate to control the volume of logs received.

  5. Security Measures: Utilize HTTPS or TLS as recommended by Epycbyte for secure communication.

  6. Error Handling: Implement proper error responses when signature verification fails, ensuring clients are informed of issues.

  7. Testing: Use tools like curl or Postman to test your setup with both valid and invalid signatures.