Logging
If an error occurs in any of the processes it will be written to the respective log file such as /var/log/overleaf/web.log
.
Toolkit users can have a look at the logs inside the container using the bin/logs
script:
# You can use the following command to view the web service logs
bin/logs web
# You can use --help for help
bin/logs --help
# You can also look at the logs for multiple services at once:
bin/logs filestore docstore web clsi
# You can follow the log output using the -f flag
bin/logs -f filestore docstore web clsi
# You can use the -n {number} flag to limit the number of lines to print (default 50)
bin/logs -n 50 web
# You can use the -n all flag to show all log lines
bin/logs -n all web
# You can use > to redirect the output to a file
bin/logs -n all web > web.log
You can use the bin/logs
script to view logs for the following services: clsi
, contacts
, docstore
, document-updater
, filestore
, git-bridge
, mongo
, notifications
, real-time
, redis
, spelling
, tags
, track-changes
, web
, web-api
, history-v1
, project-history
.
Copying logs
You can copy log files from the main sharelatex
container to local computer using the following command:
docker cp sharelatex:/var/log/overleaf/{service-name}.log {service-name}.log
Persisting logs
Docker containers are ephemeral which means that any files/directories created within the container during runtime will be discarded if the container is ever recreated (for example, when running the bin/up
command). This includes log files.
If you'd like to retain access to important log files between container recreation, you can set the environment variable OVERLEAF_LOG_PATH
in the config/overleaf.rc
file with the Toolkit. This variable should be set to the directory on the host that will be mounted to the log directory inside the sharelatex
container. Once you've made this configuration change and run the bin/up
command, log files will be persisted and you'll be able to access the logs directly from the Docker host.
Last updated
Was this helpful?