#!/bin/bash
# Run on the server (sudo or root) to create log dir and files so tail -f works.
# Log files stay empty until the API is started (systemd or manual).

LOG_DIR="/var/log/plagis"
mkdir -p "$LOG_DIR"
touch "$LOG_DIR/api.log" "$LOG_DIR/api-error.log"
chmod 644 "$LOG_DIR/api.log" "$LOG_DIR/api-error.log"
echo "Created $LOG_DIR and log files. Start the API (systemd or manual) then: tail -f $LOG_DIR/api.log $LOG_DIR/api-error.log"
