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).
1
plextrac logs
Copied!
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.
1
docker ps
Copied!
Step 2: Follow the logs of individual containers by running one of the following commands:
1
# API Logs
2
docker logs -f plextrac-plextracapi-1
Copied!
1
# NGINX Logs
2
docker logs -f plextrac-plextracnginx-1
Copied!
1
# Database Logs
2
docker logs -f plextrac-plextracdb-1
Copied!
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.
1
sudo usermod -a -G systemd-journal plextrac
Copied!
Step 2: As the plextrac user, a variation of the following journalctl commands can be used to access older container logs.
1
# View logs from plextracapi for the past 10 minutes
2
journalctl CONTAINER_NAME=plextrac-plextracapi-1 --since="10 minutes ago"
Copied!
1
# Follow live logs from plextracapi
2
journalctl -f CONTAINER_NAME=plextrac-plextracapi-1
Copied!
1
# Mix relative and precise timestamps to filter output
2
journalctl CONTAINER_NAME=plextrac-plextracapi-1 --since="2021-09-08 19:03" --until "1 days ago"
Copied!
1
# Only display the bare logs (not the extra info from journald)
2
journalctl CONTAINER_NAME=plextracapi-plextracapi-1 -o cat
Copied!
Click Next below to learn about restoring procedures.