Skip to main content

Locating and Collecting Log Files

This page explains where each TDengine component writes its log files, how to confirm the effective log directory, and how to collect and package logs when asking for technical support. For how logs are written, rotated, and archived, see Logging System.

Default Log Directory​

The server, the client, and most components write to the same log directory by default:

Operating systemDefault log directoryDefault configuration directory
Linux/var/log/taos/etc/taos
macOS/var/log/taos/etc/taos
WindowsC:\TDengine\logC:\TDengine\cfg

If logDir (taosd and the client) or log.path (other components) has been changed in a configuration file, use the configured path. See Confirm the Effective Log Directory.

In a Docker deployment, logs are inside the container at /var/log/taos. Map that directory to the host with -v. See Docker Deployment.

Log Files by Component​

The table uses the default Linux directory. On Windows, replace /var/log/taos with C:\TDengine\log. <instance ID> is the component instanceId. <date> uses the YYYYMMDD format.

ComponentDefault directoryFile nameControlled by
taosd/var/log/taostaosdlog.0, taosdlog.1logDir in taos.cfg. See taosd Reference
Client/var/log/taostaoslogX.YlogDir in the client taos.cfg. See taosc Reference
Slow query log/var/log/taostaosslowlog.<year-month-day>logDir in the client taos.cfg
UDF/var/log/taostaosudfdlog.*; taospyudf.loglogDir in taos.cfg. See User-Defined Functions (UDF)
MQTT subscription/var/log/taostaosmqttdlog.*logDir in taos.cfg. See MQTT Data Subscription
Xnode daemon/var/log/taostaosxnoded_<instance ID>_<date>.loglogDir in taos.cfg. See Data Ingestion (Xnode)
taosAdapter/var/log/taostaosadapter_<instance ID>_<date>.loglog.path in taosadapter.toml. See taosAdapter Reference
taosKeeper/var/log/taostaoskeeper_<instance ID>_<date>.loglog.path in taoskeeper.toml. See taosKeeper Reference
taosExplorer/var/log/taostaosexplorer_<instance ID>_<date>.loglog.path in explorer.toml. See taosExplorer Reference
taosX/var/log/taostaosx_<instance ID>_<date>.loglog.path in taosx.toml. See taosX Reference
taosX-Agent/var/log/taostaosx_agent_<instance ID>_<date>.loglog.path in agent.toml. See Configuration Reference
TDgpt (taosanode)/var/log/taos/taosanodeerror.log, access.log, taosanode.app.logTDgpt configuration file. See Anode Management
License center (CLS)/var/log/taosclstaoscls.logfile in the [log] section of the CLS configuration file. See Deploy and Activate

After a file is rotated by day or by size, the older file keeps a date, a sequence number, or a .gz suffix. For troubleshooting, the files modified around the time of the problem are usually enough.

Confirm the Effective Log Directory​

  • taosd: In the taos shell, run SHOW DNODES; to obtain dnode_id, then run SHOW DNODE <dnode_id> VARIABLES LIKE 'logDir';. You can also check the server configuration file: grep -i '^logDir' /etc/taos/taos.cfg.
  • Client: In the taos shell, run SHOW LOCAL VARIABLES LIKE 'logDir';, or inspect taos.cfg on the client machine.
  • taosAdapter, taosKeeper, taosExplorer, taosX, and taosX-Agent: Check path in the [log] section of the corresponding TOML file. Some components also accept --log.path or an environment variable, such as TAOS_ADAPTER_LOG_PATH or TAOS_KEEPER_LOG_PATH. Those override the configuration file.
  • If taosd was started with -o, logs are written to the location given by that option. See taosd Reference.

For the full SQL syntax, see SHOW Commands.

When a Service Fails to Start​

If a service fails before it opens its log file, the log directory may contain no related record. Check the system service log:

systemctl status taosd
journalctl -u taosd --since "1 hour ago"

For another component, replace taosd with the service name, such as taosadapter, taoskeeper, taos-explorer, taosx, or taosx-agent. On macOS, check launchd.log.

For the location of a core dump after a crash, see Linux Debugging Tools.

Collect Logs for Technical Support​

  1. If the problem can be reproduced, raise the log level first.

    • Server: run ALTER ALL DNODES 'debugFlag' '135';, or change one node with ALTER DNODE <dnode_id> 'debugFlag' '135';. You can also add debugFlag 135 at the end of taos.cfg and restart taosd.
    • Client: in the taos shell, run ALTER LOCAL 'debugFlag' '135';. This applies only to the current process.
  2. Reproduce the problem and note the approximate time.

  3. On each related node, package the log directory and the configuration directory:

    tar czf tdengine-$(hostname)-$(date +%Y%m%d%H%M).tar.gz /var/log/taos /etc/taos

    On Windows, compress C:\TDengine\log and C:\TDengine\cfg. If the log directory is large, include only the files modified around the time of the problem.

  4. Review configuration files before sending them. Some files, such as taoskeeper.toml, contain a database user name and password. Remove those values or replace them with placeholders.

  5. Include the TDengine version, operating system, deployment method, reproduction steps, and the time of the problem. Submit them as described in FAQ and Feedback.

  6. After the problem is identified, set the log level back to 131, for example ALTER ALL DNODES 'debugFlag' '131';. Level 135 produces a large volume of logs and reduces performance, so do not leave it enabled during normal operation.