Ingesting Terminal Logs with Loghead Cloud

A step-by-step guide to streaming and analyzing terminal logs directly in the Loghead Cloud UI.

# Step-by-Step Setup

Create a New Project

Go to your Loghead Cloud dashboard and click 'Create Project'. Choose a clear, recognizable name to keep your logs organized.

Creating a new project in the Loghead Cloud dashboard

Creating a new project in the Loghead Cloud dashboard

Add a Terminal Data Stream

Inside your project, click 'Create New Stream'. Provide a recognizable name for your stream and select 'Terminal' as the stream type.

Selecting 'Terminal' as the data stream type

Selecting 'Terminal' as the data stream type

Get Your Ingestion Credentials

After creating the stream, Loghead will generate a unique Stream ID and Ingestion Key. Copy these credentials.

Configure Your Environment

Export the credentials as environment variables in your local terminal or CI/CD pipeline. Alternatively, you can copy the CLI ingestion command directly from the Loghead Cloud dashboard.

Using the CLI ingestion command in a project configuration file

Using the CLI ingestion command in a project configuration file

CODE
export LOGHEAD_STREAM_ID=your_stream_id export LOGHEAD_API_KEY=your_api_key

Stream Your Logs

Pipe your command output directly to Loghead using the ingestion CLI.

Using the CLI ingestion command and using it in a porject config file

Using the CLI ingestion command and using it in a porject config file

CODE
your-command | npx @loghead/terminal --api https://www.loghead.dev --token <STREAM_TOKEN>

Universal Terminal Logging in Loghead Cloud

Streaming terminal logs to Loghead Cloud provides real-time observability for your build processes, cron jobs, and custom CLI tools.

terminal — zsh
npm run build | npx @loghead/terminal
[Loghead] Streaming logs... [Loghead] Successfully ingested 42 log lines.
ERROR
AI Insight:

Why Ingest Terminal Logs?

When running complex build processes (like Next.js builds or Docker image generation) or long-running CI/CD scripts, keeping track of the terminal output across multiple environments can be challenging. By piping these logs directly to Loghead Cloud via the UI integration, you gain:

  • Centralized storage for all your terminal outputs.
  • Powerful search to quickly find errors or warnings across historical runs.
  • Shareable URLs to send specific log traces to team members.

Getting Started via the UI

By following the solution steps above, you can securely stream any standard output directly into your cloud dashboard. After successfully sending your first terminal logs, try exploring the Search and Analytics tabs in the Loghead Cloud UI to filter your CLI logs by severity, timestamp, and specific keywords.

Ready to modernize
your logging workflow?

# Other Integrations