VMmanager saves information about the operation of services in log files. The data from log files can be used to diagnose the platform operation.
Log files list
Main log files
The main log files of VMmanager services are stored in the vm_box container in the /var/log/ directory. Usually the name of the log file is the same as the service name. For example, the log file of the vmwatch service is called vmwatch.log.
Platform installation
The platform installation log is saved in the file /opt/ispsystem/vm/install.log.
Various services
Log files on the cluster node
Working with logs
Copy log file from a container
To copy a log file from the container to the current directory, run the command:
docker cp <container_name>:<path_to_log> ./
docker cp auth:/var/log/licupdate.log ./
View log files in a container
-
Enter the required container:
docker exec -it <container_name> sh
Comments to the commandExample commanddocker exec -it vm_box sh
-
View the log file using standard Linux utilities. For example, cat, tail, less, etc.
Example commandless /var/log/host.log
To view the logs of a specific task:
- In the platform interface go to the Tasks → select the task → copy the request_id value.
-
Run the command:
grep <request_id> /var/log/*
Comments to the command
-
Exit the container:
exit
Viewing log files via stdout
Separate log files are not created for some services. Logs of these services are written to stdout. To view such logs, run the command:
docker logs <container_name> --tail <lines> --since <period>
docker logs vm_box --tail 100 --since 60m
Collecting platform logs
To collect all the log files of the platform in one directory:
- Connect to the server with the platform via SSH.
-
Create the bash script logs_collect.sh with the following content:
#!/bin/bash rm /home/logs -fr DOCKER_CONTAINER_NAMES=`docker ps --format '{{.Names}}'` SERVICES=($DOCKER_CONTAINER_NAMES) cd /home mkdir -p logs cd logs for service in ${SERVICES[@]} do echo -e "----\033[0;31mCopying logs from $service\033[0m----\n" mkdir -p $service docker cp $service:/var/log/. $service/. docker logs $service > $service/${service}_stdout.log 2>&1 done cp -r /opt/ispsystem/*/install.log install.log ARCHIVE_NAME="logs_$(date +'%Y_%m_%d_%H_%M_%S').tar.gz" tar -cvzf /home/$ARCHIVE_NAME -C /home/logs .
-
Run the script:
bash logs_collect.sh
The log files will be saved in the /home/logs/ directory, the log archive will be saved in the /home/ directory.
Logging to journald
By default, logging in the journald system service is disabled in the platform. To enable logging:
- Connect to a server with the platform via SSH.
-
Create the patch file /opt/ispsystem/vm/journald.yaml with the contents:
version: "3.5" services: auth: volumes: - /var/run/systemd/journal/:/var/run/systemd/journal/ ldap: volumes: - /var/run/systemd/journal/:/var/run/systemd/journal/ vm_box: volumes: - /opt/ispsystem/vm/backup:/opt/ispsystem/vm/backup - /opt/ispsystem/license:/opt/ispsystem/license - /opt/ispsystem/vm/socket/:/opt/ispsystem/vm/vmbox/ - /var/run/systemd/journal/:/var/run/systemd/journal/
-
Apply the patch:
vm add-patch -p journald -f /opt/ispsystem/vm/journald.yaml