Sign inSign up

dockhost/logger

By dockhost

•Updated 5 days ago

Real-time container log collector and exporter for Dockhost platform.

Image
Developer tools
Monitoring & observability
0

384

dockhost/logger repository overview

Real-time container log collector and exporter for Dockhost platform.

Quick Start:

docker run -e DOCKHOST_TOKEN=your_token dockhost/logger:latest

⁠Dockhost Logger Service

Collects and exports container logs from the Dockhost platform in real-time.

⁠Overview

Dockhost Logger Service automatically discovers projects and containers on the Dockhost platform, collects their logs in real-time, and exports them through a flexible pipeline architecture. The service processes logs through configurable sources, transforms, and multiple output backends simultaneously.

⁠Features

  • Automatic Discovery: Detects new projects and containers automatically
  • Real-time Collection: Collects logs in real-time with deduplication
  • Pipeline Architecture: Route logs through sources → transforms → backends
  • Transform Types: Filter, remap, parse JSON/regex/nginx, extract levels, templates, conditional logic, and JavaScript scripting with sandbox isolation
  • Multiple Backends: Export to various destinations with buffering and automatic reconnection
  • Flexible Routing: Route different log streams to different backends based on project/container filters
  • Graceful Shutdown: Properly closes connections and flushes buffers on termination
  • Configurable: YAML-based configuration with environment variable overrides

⁠Supported Backends

BackendDescription
ConsoleOutput logs to stdout in text or JSON format
FileWrite logs to files with rotation and buffering
SyslogSend logs to syslog server via UDP or TCP
OpenSearchIndex logs with retention policies and dashboards
LogflareSend logs to Logflare via HTTP API
LokiSend logs to Grafana Loki via Loki Push API
VictoriaLogsSend logs to VictoriaLogs via Loki-compatible API
OTLPSend logs via OpenTelemetry Protocol (OTLP/HTTP)

⁠Quick Start

Run with minimal configuration:

docker run -e DOCKHOST_TOKEN=your_token dockhost/logger:latest

⁠Environment Variables

VariableRequiredDefaultDescription
DOCKHOST_TOKENYes—Dockhost API access token
DOCKHOST_CONFIG_PATHNoAuto-detectPath to YAML configuration file

⁠Configuration

Mount a custom configuration file to enable backends:

docker run \
  -e DOCKHOST_TOKEN=your_token \
  -v ./config.yaml:/app/config.yaml \
  dockhost/logger:latest

Example config.yaml:

# Define log sources
sources:
    all-logs:
    auth-only:
        projects:
            - name: my-project
              containers:
                  - regex: ".*-auth"

# Transform logs
transforms:
    filter-errors:
        type: filter
        action: keep
        condition: '.level == "error"'

# Configure backends
backends:
    console-all:
        type: console
        enabled: true
        sources: [all-logs]
        config:
            format: text

    opensearch-all:
        type: opensearch
        enabled: true
        sources: [all-logs]
        config:
            host: http://localhost:9200
            index: dockhost-logs
            indexStrategy: daily

⁠Usage Examples

Quick Start:

docker run -e DOCKHOST_TOKEN=your_token dockhost/logger:latest

With custom configuration:

docker run \
  -e DOCKHOST_TOKEN=your_token \
  -v ./config.yaml:/app/config.yaml \
  dockhost/logger:latest

Tag summary

Content type

Image

Digest

sha256:b962010e5…

Size

63.7 MB

Last updated

5 days ago

docker pull dockhost/logger