Logging

Streaming and exporting logs from the Docker image

By default logs are collected for feature improvement purposes. To disable collection of these logs you can contact support to disable this feature.

Using the Loki protocol to forward logs to your own log aggregation infrastructure

The omni container ships with support for the Loki protocol. The container can be configured to send logs to your own service that runs a Loki compatible protocol. You must contact support to enable this feature. You also need to supply a LOKI_URL environment variable to the container.

Example

Assuming you have a Loki compatible push endpoint running at https://my-internal-loki-service/loki/api/v1/push. This is an example compose file that would push logs to that endpoint:

services:
  app:
    image: omniai:latest
    container_name: omniai
    ports:
      - "3000:3000"
      - "4000:4000"
    volumes:
      - pgdata:/var/lib/postgresql/16/main
    environment:
      - OMNI_PRODUCT_KEY="12345"
      - LOKI_URL=https://my-internal-loki-service/loki/api/v1/push
volumes:
  pgdata:
    name: omni_pg_data

Manual inspection of logs

If you would like to examine these log files or collect them yourself, then you can mount them as a named volume. They are stored in /tmp/ within the container, and should match the glob pattern omni-*.{out,err,log}

Simpified Example

This is a compose file that demonstrates how to setup a very simple log monitoring container. This container simply tails all the logs and then outputs them to the docker console log.

services:
  app:
    image: omniai:latest
    container_name: omniai
    ports:
      - "3000:3000"
      - "4000:4000"
    volumes:
      - pgdata:/var/lib/postgresql/16/main
      - logs:/tmp/
    environment:
      - OMNI_PRODUCT_KEY="12345"
  log-tailer:
    image: ubuntu:24.04
    command: bash -c 'sleep 10; tail -f /omni-logs/omni-*.{out,err,log}'
    volumes:
      - logs:/omni-logs/
volumes:
  pgdata:
    name: omni_pg_data
  logs:
    name: omniai_logs    

Last updated