Enabling debug logging in ONLYOFFICE Docs

Overview

In certain cases, it is necessary to run ONLYOFFICE Docs in debug mode — for example, to troubleshoot performance issues, inspect logs, or collect information for support.

There are two options to launch the ONLYOFFICE Docs in debug mode.

Option 1. Using the environment variable (Docker only)

If you are managing the ONLYOFFICE Docs container via Docker or Docker Compose, it is preferable to use an environment variable to enable the debug log level:

Docker
  1. Set the environment variable with docker run:

    docker run -i -t -d -p 8080:80 \
      -e DS_LOG_LEVEL=DEBUG \
      onlyoffice/documentserver-de:latest
  2. Restart the container if it is already running:

    docker restart <container>
  3. Logs can be viewed with:

    docker logs -f <container>
Docker Compose
  1. Set the environment variable in docker-compose.yml when running the container:

    services:
        documentserver:
          image: onlyoffice/documentserver-de:latest
          container_name: documentserver
          restart: always
          environment:
            - DS_LOG_LEVEL=DEBUG
          ports:
            - "8080:80"
  2. Start Docker Compose:

    docker-compose up -d
  3. Restart the container if it is already running:

    docker-compose restart documentserver
  4. Logs can be viewed with:

    docker-compose logs -f documentserver

Option 2. Using the log4js configuration file

To launch the ONLYOFFICE Docs in the debug mode:

  1. Open the log4js configuration file. The path to the file depends on the operating system you use:

    • For Windows - C:\Program Files\ONLYOFFICE\DocumentServer\config\log4js\production.json
    • For Linux - /etc/onlyoffice/documentserver/log4js/production.json
    • For Docker - /etc/onlyoffice/documentserver/log4js/production.json (within the Docker container)
  2. Refer to the following code block

    {
      "categories": {
        "default": {
          "appenders": [
            "default"
          ],
          "level": "WARN"
        }
      }
    }
  3. Change the level value from "WARN" to "DEBUG".
  4. Save the changes in the production.json configuration file.
  5. Apply the changes executing the following command:

    Linux

    systemctl restart ds-*

    Docker

    supervisorctl restart all

    Or restart the ONLYOFFICE DocumentServer Proxy service for Windows:

    net stop DsProxySvc
    net start DsProxySvc
    net stop DsConverterSvc
    net start DsConverterSvc
    net stop DsDocServiceSvc
    net start DsDocServiceSvc
  6. The logs are stored in the following locations (depending on the installation type):

    • For Windows - C:\Program Files\ONLYOFFICE\DocumentServer\Log
    • For Linux - /var/log/onlyoffice/documentserver
    • For Docker - /var/log/onlyoffice/documentserver (within the Docker container) and /app/onlyoffice/DocumentServer/logs/documentserver (on the host if you mount the volume)

Host ONLYOFFICE Docs on your own server or use it in the cloud

Article with the tag:
Browse all tags