Directory Layout and Storage
By default, Xylok installs to /opt/xylok
and these instructions assume this location. If installed to a different location, adjust the example commands as needed.
Inside the install directory may be a few important directories. Not all will necessarily be present and these will generally be created when Xylok starts if they are needed.
_passthrough/
: User-accessible location for moving data in and out of the container. While there are other directories mounted into the container, this passthrough directory is the recommended method because there are no automatic cleanups or Xylok processes that directly touch it.ad-certs/
: Used for Active Directory certifications when using AD authenticationbackups/
: This directory is the default location for automatic update backups during backups and periodic backups using the built-in script. See Backups for more information.certs/
: This directory containscert.crt
andkey.key
PEM files which will be used by the proxy for HTTPS connections to the server. See the dedicated HTTPS page for more details.
Xylok logs all data by default to /var/log/xylok
. All logs are user and group owned by the xylok
user. As of this writing, there are six processes in the container which write logs. You will find a corresponding directory inside /var/log/xylok
for each of these six and the current log for each is named current.
db
: The Xylok Postgres servermx
: A simple maintenance script which takes care of cleaning old files in temporary directoriesproxy
: The Nginx process which routes traffic to the Xylok backend, serves static files, and handles SSL certificates.redis
: The Xylok Redis server, which handles user session storage and communication with the backend workers running longer tasks.web
: The Xylok frontend, responding to requests when you navigate in the browserworker
: The Xylok backend process, handling longer processing tasks
If desired, these logs can be directly accessed. For quick administrative and debugging needs, they can are accessible to two additional ways.
Super users may access the server logs by logging in to Xylok and going to the User Menu -> Server Logs. The last hundred lines of each current log are recorded here.
For users with access to the command line, or if Xylok is not responding to the web browser, logs can also be quickly checked by running /opt/xylok/xylok logs -f:
traherom@install-testing /o/xylok [SIGINT]> /opt/xylok/xylok logs -f
[sudo] password for traherom:
==> /var/log/xylok/db/current <==
================================================
== Started at Fri 25 Mar 2022 07:32:55 PM UTC ==
PostgreSQL Database directory appears to contain a database; Skipping initialization
2022-03-25 19:32:55.847 GMT [59] LOG: listening on IPv4 address "0.0.0.0", port 5432
2022-03-25 19:32:55.847 GMT [59] LOG: listening on IPv6 address "::", port 5432
2022-03-25 19:32:55.851 GMT [59] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-03-25 19:32:55.859 GMT [86] LOG: database system was shut down at 2022-03-25 19:32:43 GMT
2022-03-25 19:32:55.871 GMT [59] LOG: database system is ready to accept connections
==> /var/log/xylok/proxy/current <==
162.158.62.224 - - [26/Mar/2022:19:27:51 +0000] "GET /api/v1/tasks/ HTTP/1.1" 200 83 "https://testing.xylok.io/reference/benchmark/cisco_ios_router_rtr_stig/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:97.0) Gecko/20100101 Firefox/97.0"
162.158.62.224 - - [26/Mar/2022:19:27:51 +0000] "GET /api/v1/tasks/ HTTP/1.1" 200 83 "https://testing.xylok.io/result/analyze/7f02bb52-b345-44a1-9f9c-9327a6fdd601/08fe530b-fd15-4e7c-b699-cf33cea2b6d6/?offset=0&limit=15&general_search=&stig_id=&command=&comment=&check_details=&statuses=%5B%5D&severity=" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
108.162.219.51 - - [26/Mar/2022:19:27:52 +0000] "GET /api/v1/tasks/ HTTP/1.1" 401 58 "https://testing.xylok.io/tasks/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0"
162.158.62.224 - - [26/Mar/2022:19:27:52 +0000] "GET /api/v1/tasks/ HTTP/1.1" 200 83 "https://testing.xylok.io/reference/benchmark/cisco_ios_router_rtr_stig/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:97.0) Gecko/20100101 Firefox/97.0"
162.158.62.224 - - [26/Mar/2022:19:27:52 +0000] "GET /api/v1/tasks/ HTTP/1.1" 200 83 "https://testing.xylok.io/result/analyze/7f02bb52-b345-44a1-9f9c-9327a6fdd601/08fe530b-fd15-4e7c-b699-cf33cea2b6d6/?offset=0&limit=15&general_search=&stig_id=&command=&comment=&check_details=&statuses=%5B%5D&severity=" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
108.162.219.51 - - [26/Mar/2022:19:27:53 +0000] "GET /api/v1/tasks/ HTTP/1.1" 401 58 "https://testing.xylok.io/tasks/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0"
162.158.62.224 - - [26/Mar/2022:19:27:53 +0000] "GET /api/v1/tasks/ HTTP/1.1" 200 83 "https://testing.xylok.io/reference/benchmark/cisco_ios_router_rtr_stig/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:97.0) Gecko/20100101 Firefox/97.0"
162.158.62.224 - - [26/Mar/2022:19:27:53 +0000] "GET /api/v1/tasks/ HTTP/1.1" 200 83 "https://testing.xylok.io/result/analyze/7f02bb52-b345-44a1-9f9c-9327a6fdd601/08fe530b-fd15-4e7c-b699-cf33cea2b6d6/?offset=0&limit=15&general_search=&stig_id=&command=&comment=&check_details=&statuses=%5B%5D&severity=" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
108.162.219.51 - - [26/Mar/2022:19:27:54 +0000] "GET /api/v1/tasks/ HTTP/1.1" 401 58 "https://testing.xylok.io/tasks/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0"
108.162.219.51 - - [26/Mar/2022:19:27:54 +0000] "POST /jsnlog.logger/ HTTP/1.1" 401 58 "https://testing.xylok.io/tasks/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0"
==> /var/log/xylok/redis/current <==
38:M 26 Mar 2022 19:22:40.034 * 10 changes in 300 seconds. Saving...
38:M 26 Mar 2022 19:22:40.036 * Background saving started by pid 222251
222251:C 26 Mar 2022 19:22:40.148 * DB saved on disk
222251:C 26 Mar 2022 19:22:40.150 * RDB: 3 MB of memory used by copy-on-write
...
This display follows all the current logs, letting you quickly check if particular requests are causing errors.
For debugging purposes, full server logs are often the most helpful when sending to Xylok Support. The xylok logs command also helps with this:
traherom@install-testing /o/xylok [1]> /opt/xylok/xylok logs --output ~/logs.zip
INFO:main:Saving logs to /home/traherom/logs.zip
INFO:main:Gathering container logs
INFO:main:Gathering container processes and memory information
INFO:main:Gathering db component logs
INFO:main:Gathering proxy component logs
INFO:main:Gathering redis component logs
INFO:main:Gathering web component logs
INFO:main:Gathering worker component logs
INFO:main:Gathering mx component logs
Logs saved to /home/traherom/logs.zip
Sending the complete ZIP file to Xylok support will provide all recent errors in all processes, helping us narrow down your issue quickly. In addition the the logs discussed earlier, the log bundle also includes logs from container initialization, configuration data, running processes inside the container, and memory usage. We make an effort not to bundle passwords or secrets into these files, but you are of course free to redact data if needed.