Skip to content

Logs

This page documents how to check logs for the live Magikal services.

Main services

Service Purpose
magikal-bot Live Discord bot
magikal-panel-api FastAPI backend for the web panel
magikal-panel-web Static frontend for the web panel

Bot logs

Check the last 100 bot log lines:

sudo journalctl -u magikal-bot -n 100 --no-pager

Follow live bot logs:

sudo journalctl -u magikal-bot -f

Check logs since the last boot:

sudo journalctl -u magikal-bot -b --no-pager

Check logs from today:

sudo journalctl -u magikal-bot --since today --no-pager

Check logs from the last hour:

sudo journalctl -u magikal-bot --since "1 hour ago" --no-pager

Panel API logs

Check the last 100 panel API log lines:

sudo journalctl -u magikal-panel-api -n 100 --no-pager

Follow live panel API logs:

sudo journalctl -u magikal-panel-api -f

Check panel API logs from today:

sudo journalctl -u magikal-panel-api --since today --no-pager

Panel web logs

Check the last 100 panel web log lines:

sudo journalctl -u magikal-panel-web -n 100 --no-pager

Follow live panel web logs:

sudo journalctl -u magikal-panel-web -f

Check panel web logs from today:

sudo journalctl -u magikal-panel-web --since today --no-pager

Useful filtering

Filter bot logs for errors:

sudo journalctl -u magikal-bot -n 300 --no-pager | grep -i error

Filter bot logs for tracebacks:

sudo journalctl -u magikal-bot -n 300 --no-pager | grep -i traceback

Filter bot logs for a specific event name:

sudo journalctl -u magikal-bot -n 300 --no-pager | grep "tickets."

Filter panel API logs for errors:

sudo journalctl -u magikal-panel-api -n 300 --no-pager | grep -i error

Filter panel web logs for errors:

sudo journalctl -u magikal-panel-web -n 300 --no-pager | grep -i error

Good signs

After a restart, good logs usually show:

  • service starts without a Python traceback
  • no repeated restart loop
  • no missing module errors
  • no database connection failures
  • no token/auth failures
  • no permission errors for files or folders

Red flags

Investigate if logs show:

  • Traceback
  • SyntaxError
  • ModuleNotFoundError
  • ImportError
  • Permission denied
  • database connection failed
  • asyncpg
  • psycopg
  • token
  • 401
  • 403
  • 404
  • repeated systemd restarts

What to paste when asking for help

For bot issues, paste:

sudo systemctl status magikal-bot --no-pager
sudo journalctl -u magikal-bot -n 120 --no-pager

For panel API issues, paste:

sudo systemctl status magikal-panel-api --no-pager
sudo journalctl -u magikal-panel-api -n 120 --no-pager

For panel web issues, paste:

sudo systemctl status magikal-panel-web --no-pager
sudo journalctl -u magikal-panel-web -n 120 --no-pager

For Git state, paste:

cd /home/magikalbot/magikal-bot
git status --short
git log --oneline --max-count=5

Or for panel work:

cd /home/magikalbot/magikal-panel
git status --short
git log --oneline --max-count=5

Privacy reminder

Logs should not contain raw Discord IDs, mentions, secrets, tokens, or personal data.

When sharing logs, check for secrets first.