HUB
Sign inSign up

schenanigans/loggarr

By schenanigans

•Updated over 1 year ago

Container Logs Made Easy

Image
0

3.5K

schenanigans/loggarr repository overview

⁠Loggarr - Docker Container Log Viewer

A lightweight, web-based Docker container log viewer with a clean, modern interface.

╦  ╔═╗╔═╗╔═╗╔═╗╦═╗╦═╗
║  ║ ║║ ╦║ ╦╠═╣╠╦╝╠╦╝
╩═╝╚═╝╚═╝╚═╝╩ ╩╩╚═╩╚═

⁠Quick Start

docker run -d \
  --name loggarr \
  -p 3456:3456 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /etc/localtime:/etc/localtime \
  schenanigans/loggarr:latest

Access the web interface at: http://localhost:3456⁠

⁠What is Loggarr?

Loggarr is a minimal Alpine-based Docker container that provides a web interface for viewing real-time logs from your Docker containers. It's designed to be lightweight, fast, and easy to use.

⁠Key Features
  • Auto-streaming logs - Select a container and logs start streaming automatically
  • Pause/Resume - Pause the stream to read through logs carefully
  • Copy to clipboard - One-click copy with formatted metadata header
  • Save to file - Optional log saving to disk (when enabled)
  • Timestamps - All logs include timestamp information
  • Industry-standard log colors - Different log levels are color-coded for easy scanning
  • Responsive design - Works on desktop and mobile devices
  • Multi-platform - Supports linux/amd64, linux/arm64, and linux/arm/v7

⁠Installation

⁠Using Docker Run
docker run -d \
  --name loggarr \
  --restart unless-stopped \
  -p 3456:3456 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /etc/localtime:/etc/localtime \
  schenanigans/loggarr:latest
⁠Using Docker Compose

Create a compose.yaml file:

services:
  loggarr:
    image: schenanigans/loggarr:latest
    container_name: loggarr
    ports:
      - "3456:3456"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /etc/localtime:/etc/localtime
    restart: unless-stopped

Then run:

docker compose up -d

⁠Configuration

⁠Environment Variables
VariableDefaultDescription
LOG_LEVELinfoLogging verbosity (debug, info, warn, error, fatal)
ENABLE_LOG_SAVINGfalseEnable saving logs to disk (requires volume mount)
LOG_TAIL_SIZE50Number of initial lines to show when starting log stream
MAX_BUFFER_SIZE10Max buffer size for log streaming (in MB)
⁠Examples

Run with debug logging:

docker run -d \
  --name loggarr \
  -e LOG_LEVEL=debug \
  -p 3456:3456 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  schenanigans/loggarr:latest

Run on a different port:

docker run -d \
  --name loggarr \
  -p 8080:3456 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /etc/localtime:/etc/localtime \
  schenanigans/loggarr:latest

Enable log saving:

docker run -d \
  --name loggarr \
  -e ENABLE_LOG_SAVING=true \
  -p 3456:3456 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /etc/localtime:/etc/localtime \
  -v ./logs:/app/logs \
  schenanigans/loggarr:latest

⁠Usage

  1. Open the web interface at http://localhost:3456⁠ (or your mapped port)
  2. Select a container from the dropdown menu
  3. Logs start streaming automatically
  4. Use the controls:
    • Pause/Resume - Stop/start the log stream
    • Clear - Clear the current log display
    • Copy - Copy logs with formatted header to clipboard
    • Save - Save logs to file (appears when paused, if enabled)
    • Refresh - Reload the container list
⁠Log Level Colors
  • FATAL/ERROR - Red
  • WARN - Yellow/Orange
  • INFO - Blue
  • DEBUG - Gray
  • TRACE - Purple
  • SUCCESS - Green

⁠Log Saving

When log saving is enabled (ENABLE_LOG_SAVING=true), you can save logs to disk:

  1. Pause the log stream
  2. Click the "Save" button that appears
  3. Logs are saved to the mounted volume with filename: {container}-{timestamp}.log
⁠Log Format

Saved logs include a metadata header:

# Loggarr Export
# Container: nginx
# Exported: 2025-01-10T23:45:00.123Z
# Total Lines: 150
==================================================

[Log entries follow...]

⁠Network Configuration

Loggarr accesses container logs through the Docker socket mount, so it can view logs from any container regardless of network configuration. You don't need to put containers on the same network as Loggarr for log viewing to work.

⁠Security Considerations

  • Loggarr requires access to the Docker socket to read container logs
  • Only mount the Docker socket as read-only if possible: -v /var/run/docker.sock:/var/run/docker.sock:ro
  • Consider running behind a reverse proxy with authentication for production use
  • The container runs with minimal privileges using Alpine Linux

⁠Troubleshooting

⁠No containers showing up
  • Ensure the Docker socket is mounted correctly
  • Check that the container has permissions to access the Docker socket
  • Verify other containers are running: docker ps
⁠Cannot access web interface
  • Check the port mapping: docker ps
  • Ensure no firewall is blocking port 3456
  • Try accessing via localhost instead of hostname
⁠Logs not streaming
  • Refresh the page and try selecting the container again
  • Check browser console for errors (F12)
  • Verify the container is producing logs: docker logs <container_name>

⁠Version Information

When Loggarr starts, it displays version information in the console:

The version is also displayed in the web interface header.

⁠Support

Tag summary
Recent tags
Content type
Image
Digest
sha256:25b1981f8…
Size
81.4 MB
Last updated
over 1 year ago
docker pull schenanigans/loggarr:latest