Accessing Logs
This page provides instructions for accessing live logs from running containers and historical logs.

Prerequisites

Command-line access to the server with PlexTrac installed and running

Method #1

Step 1: As the plextrac user, run the plextrac logs command. This will display logs from all running containers (API, NGINX, Redis, Database).
plextrac logs
Step 2: Use Ctrl + c to stop following the logs.

Method #2

Step 1: As the plextrac user, run docker ps to list the running docker containers.
docker ps
Step 2: Follow the logs of individual containers by running one of the following commands:
# API Logs
docker logs -f plextrac-plextracapi-1
# NGINX Logs
docker logs -f plextrac-plextracnginx-1
# Database Logs
docker logs -f plextrac-plextracdb-1
Step 3: Use Ctrl + c to stop following the logs.

Accessing Historical Logs

Step 1: Use the following command to add the plextrac user to the systemd-journal group.
sudo usermod -a -G systemd-journal plextrac
Step 2: As the plextrac user, a variation of the following journalctl commands can be used to access older container logs.
# View logs from plextracapi for the past 10 minutes
journalctl CONTAINER_NAME=plextrac-plextracapi-1 --since="10 minutes ago"
# Follow live logs from plextracapi
journalctl -f CONTAINER_NAME=plextrac-plextracapi-1
# Mix relative and precise timestamps to filter output
journalctl CONTAINER_NAME=plextrac-plextracapi-1 --since="2021-09-08 19:03" --until "1 days ago"
# Only display the bare logs (not the extra info from journald)
journalctl CONTAINER_NAME=plextracapi-plextracapi-1 -o cat
Click Next below to learn about restoring procedures.