Managing Runtime Logs
The DataShyft Customer Runtime generates logs that may contain useful information for debugging misbehaving deployments. These logs are stored on the Docker persistent volume and can be accessed using the following steps. The current runtime log is located at/datashyft-config/logs/datashyft-runtime.log
The DataShyft Customer Runtime will automatically rotate its log files daily at midnight UTC/GMT. When this happens, the current log file is renamed to include the date of the logs and compressed using GZip, and a new current log file is created. The Runtime will keep old logs for up to 14 days before discarding them.
The log can be viewed using the following Docker commands.
- See a live view of the DataShyft Customer Runtime log:
docker exec -it datashyft tail -f /datashyft-config/logs/datashyft-runtime.log
- See a list of all the log files available in the DataShyft Customer Runtime container.
docker exec -it datashyft ls -l /datashyft-config/logs
- Download a copy of the DataShyft Customer Runtime log. Adjust the file name as appropriate to download historical logs.
docker cp datashyft:/datashyft-config/logs/datashyft-runtime.log .
Adjusting Runtime Log Settings
By default, the DataShyft Customer Runtime only logs warnings and errors that may occur during operation. It may be desirable, for debugging or tracing purposes, to increase the amount of logging generated. It might also be desirable to modify DataShyft's default log retention policies. DataShyft uses Apache Log4j 2 as its logging framework - more information regarding Log4j can be found on its website: https://logging.apache.org/log4j/2.x/
To change the logging configuration, edit the log4jOverrides.xml file using the following commands:
- Copy the override file to the local system
docker cp datashyft:/datashyft-config/log4jOverrides.xml ./log4jOverrides.xml
- Edit the log4jOverrides.xml file as desired using your preferred editor.
- Copy the modified override file back into the container
docker cp ./log4jOverrides.xml datashyft:/datashyft-config/log4jOverrides.xml
- Restart the Runtime container
docker restart datashyft
The overrides file contains examples of properties that can be set to affect the basic logging configuration. These properties are described briefly in the following table:
sizeBasedLogRoll |
Specifies how large a log file can get before it is rolled. The default value is “100 MB”. Once the log file reaches this size, it will be closed and a new log file opened. |
timeBasedLogRollDays |
Specifies how many days can elapse before a log is rolled. This roll will take place regardless of whether the file has reached the size threshold specified in the previous property. The default value is “1”. |
numberOfLogsToRetain |
Specifies how many log files should be retained. If the number of log files exceeds this number while rolling, the oldest log will be deleted. The default value is “14”. |