A command wrapper that executes programs while streaming their output to a remote Busl server. Designed for Platform-as-a-Service (PaaS) deployments to capture build, release, and application logs.
log-stream is a lightweight wrapper around the busltee library that:
- Executes any command while capturing stdout/stderr
- Streams output to a configured Busl server endpoint
- Preserves the original command's exit code
- Handles environment-based configuration
git clone https://github.com/aluminumio/log-stream
cd log-stream
go build -o log-stream ./cmd/log-streamBasic usage:
log-stream -- <command> [arguments...]Stream build output:
export ALUMINUMIO_STREAM_URL_BUILD=http://logs.example.com/streams/build-123
log-stream -- make buildStream application logs:
export ALUMINUMIO_STREAM_URL_APP=http://logs.example.com/streams/app-456
log-stream -- ./start-server.shStream with verbose logging:
export ALUMINUMIO_VERBOSE=true
export ALUMINUMIO_STREAM_URL_DEBUG=http://logs.example.com/streams/debug-789
log-stream -- python debug_script.py| Variable | Description | Default |
|---|---|---|
ALUMINUMIO_STREAM_URL_* |
URL to stream logs to (any suffix after _URL_ works) |
None (streaming disabled) |
ALUMINUMIO_VERBOSE |
Enable verbose logging | false |
ALUMINUMIO_TIMEOUT |
Command timeout in seconds | 1800 (30 minutes) |
ALUMINUMIO_RETRY |
Number of retries for connection failures | 5 |
DEBUG_HTTP |
Enable HTTP debug logging | false |
The stream URL should point to a Busl server stream endpoint:
http://busl-server:5001/streams/{stream-id}
https://logs.yourpaas.com/streams/{stream-id}
#!/bin/bash
# buildpack/bin/compile
BUILD_ID=$(uuidgen)
export ALUMINUMIO_STREAM_URL_BUILD="$BUSL_SERVER/streams/builds/$APP_ID/$BUILD_ID"
log-stream -- npm install
log-stream -- npm run buildweb: log-stream -- bundle exec puma -C config/puma.rb
worker: log-stream -- bundle exec sidekiq
release: log-stream -- bundle exec rake db:migrateFROM alpine:latest
COPY log-stream /usr/local/bin/
ENV ALUMINUMIO_STREAM_URL_APP=http://busl:5001/streams/app
CMD ["log-stream", "--", "/app/start.sh"]- Zero Configuration: Works without stream URL (just executes command)
- Exit Code Preservation: Returns the same exit code as the wrapped command
- Signal Forwarding: Forwards signals to the child process
- Automatic Retry: Handles temporary network failures
- Concurrent Streaming: Streams while command is running (no buffering)
# Linux
GOOS=linux GOARCH=amd64 go build -o log-stream-linux ./cmd/log-stream
# macOS
GOOS=darwin GOARCH=amd64 go build -o log-stream-darwin ./cmd/log-stream
# Windows
GOOS=windows GOARCH=amd64 go build -o log-stream.exe ./cmd/log-streamThis implementation is compatible with the original Heroku log-stream but uses:
ALUMINUMIO_*environment variables instead ofHEROKU_*- Open source Busl server instead of proprietary infrastructure
- Same command-line interface for drop-in replacement
MIT License - see LICENSE file for details