Skip to content

Log Search

Loggator provides powerful full-text search capabilities powered by Meilisearch, enabling you to find specific log entries quickly and efficiently.

Access the search interface at http://localhost:3000/search

Simply type your query in the search box:

error
exception
timeout
failed
404

Meilisearch automatically:

  • Finds relevant matches
  • Ranks results by relevance
  • Handles typos and fuzzy matching
  • Highlights matching terms

Search logs from specific containers:

  1. Click the Container dropdown
  2. Select one or more containers
  3. Results are automatically filtered

Filter by output stream:

  • stdout: Standard output (normal logs)
  • stderr: Error output (error logs)
  • Both: No filter (default)

Filter by timestamp:

  • Last 15 minutes
  • Last hour
  • Last 24 hours
  • Last 7 days
  • Custom range (date picker)

Search for any word:

error
failed
nginx

All terms must match (AND logic):

error timeout
nginx 404
database connection

Exact phrase matching with quotes:

"connection refused"
"out of memory"
"fatal error"

Not directly supported, but Meilisearch handles:

  • Prefix matching: erro matches error, errors
  • Typo tolerance: errro still finds error
Query: error
Stream: stderr
Time: Last 24 hours
Query: connection database
Container: postgres
Time: Last hour
Query: "500 Internal Server Error"
Container: nginx
Stream: stdout
Query: warning
Time: Last 15 minutes

Each result shows:

  • Timestamp: When the log was created
  • Container: Which container produced it
  • Stream: stdout (blue) or stderr (red)
  • Message: The log message with highlighted matches
  • Context: Surrounding text for better understanding
  • Copy: Copy log message to clipboard
  • Scroll: Auto-scroll to follow new logs
  • Export: Download results as JSON or CSV

Loggator indexes logs in batches:

  • Batch size: 100 logs
  • Batch timeout: 5 seconds
  • Throughput: ~1000 logs/second

Meilisearch provides:

  • Response time: <50ms for most queries
  • Typo tolerance: Built-in fuzzy matching
  • Ranking: Relevance-based sorting

For high-volume logging:

  1. Increase batch size (requires code change)
  2. Use SSD storage for Meilisearch
  3. Allocate more RAM to Meilisearch container
  4. Enable log rotation to limit index size

Search programmatically via API:

Terminal window
curl "http://localhost:3000/api/logs/search?query=error&limit=10"

See Logs API for full documentation.

Loggator does not automatically delete old logs. To implement retention:

Terminal window
# Delete logs older than 7 days
curl -X POST http://localhost:7700/indexes/logs/documents/delete \
-H "Authorization: Bearer $MEILISEARCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filter": "timestamp < '$(($(date +%s) - 604800))'"
}'
Terminal window
# Stop services
docker compose down
# Delete Meilisearch data
rm -rf ./meilisearch-data/*
# Restart services
docker compose up -d

Add a cron job:

/etc/cron.daily/loggator-cleanup
#!/bin/bash
SEVEN_DAYS_AGO=$(($(date +%s) - 604800))
curl -X POST http://localhost:7700/indexes/logs/documents/delete \
-H "Authorization: Bearer $MEILISEARCH_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"filter\": \"timestamp < $SEVEN_DAYS_AGO\"}"

❌ Generic: log ✅ Specific: connection timeout error

Combine search with filters for precision:

  • Container + Query
  • Time range + Stream
  • All three together

Some applications log errors to stdout. Always check:

  • stderr first (typical errors)
  • stdout second (application-specific)

Narrow down issues:

  • Recent problems: Last 15 minutes
  • Ongoing issues: Last 24 hours
  • Historical analysis: Last 7 days

If no results:

  • Remove some terms
  • Try synonyms (error vs fail vs exception)
  • Check spelling
  • Broaden time range
Query: error exception fatal
Stream: stderr
Container: <your-app>
Query: 500 502 503 504
Container: nginx
Stream: stdout
Query: connection refused timeout deadlock
Container: postgres
Query: "out of memory" OOM killed
Time: Last 24 hours
Query: authentication failed unauthorized 401 403

Check:

  1. Logs are being collected: Visit Dashboard
  2. Container is labeled: docker inspect <container> | grep loggator
  3. Spelling: Try simpler terms
  4. Time range: Expand the time window
  5. Indexing delay: Wait 5-10 seconds for recent logs

Causes:

  • Large index size (millions of logs)
  • Insufficient resources
  • Complex queries

Solutions:

  1. Implement log retention
  2. Increase Meilisearch RAM:
    meilisearch:
    deploy:
    resources:
    limits:
    memory: 2G
  3. Use SSD for storage

Meilisearch uses ranking. To improve:

  1. Use exact phrases in quotes
  2. Add more specific terms
  3. Use filters to narrow scope

Check:

  1. Container is running: docker ps
  2. Container has label: See Docker Setup
  3. Loggator is running: docker logs loggator
  4. Meilisearch is healthy: curl http://localhost:7700/health

Matching terms are automatically highlighted in:

  • Search results
  • AI chat responses
  • Live log viewer

Results are sorted by:

  1. Relevance (default)
  2. Timestamp (newest first)
  • Default: 50 results per page
  • Maximum: 100 results per page
  • Use API for larger result sets

Download search results:

  • JSON: Machine-readable format
  • CSV: Spreadsheet-compatible
  • Text: Plain log messages

(Feature may require implementation)