Bạn có thể sử dụng script bin/logs để xem log của các dịch vụ.Ví dụ sử dụng cơ bản:
# View the web service logsbin/logs web# Show helpbin/logs --help# View logs for multiple services at oncebin/logs filestore docstore web clsi# Follow log output (like tail -f)bin/logs -f filestore docstore web clsi# Limit the number of lines printed (default 20)bin/logs -n 50 web# Show all log linesbin/logs -n all web# Redirect output to a filebin/logs -n all web > web.log# Last 100 lines of the MongoDB log, and only the lines with errorsbin/logs -n 100 mongobin/logs -n all mongo | grep -i -E 'error|fatal'
Bạn có thể sử dụng script bin/logs để xem log của các dịch vụ sau: clsi, contacts, docstore, document-updater, filestore, git-bridge, mongo, notifications, real-time, redis, spelling, tags, track-changes, web, web-api, history-v1, project-history.
Các container Docker có tính tạm thời, nghĩa là các tệp/thư mục được tạo bên trong container trong quá trình chạy (bao gồm cả tệp log) sẽ bị xóa nếu container được tạo lại (ví dụ: khi chạy bin/up). Để giữ lại các tệp log giữa những lần tạo lại container:
Đặt biến môi trường OVERLEAF_LOG_PATH trong tệp config/overleaf.rc mà Toolkit sử dụng. Đây phải là thư mục trên máy chủ (host) sẽ được bind-mount vào thư mục log bên trong container sharelatex.
Sau khi thay đổi giá trị này và chạy bin/up -d, các tệp log sẽ được lưu giữ trên máy chủ và có thể truy cập trực tiếp.
Bạn phải đặt chủ sở hữu của thư mục log trên máy chủ dùng cho bind-mount là người dùng www-data (uid=33) và đảm bảo quyền là drwxr-xr-x (755).Ví dụ: