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 system | Default log directory | Default configuration directory |
|---|---|---|
| Linux | /var/log/taos | /etc/taos |
| macOS | /var/log/taos | /etc/taos |
| Windows | C:\TDengine\log | C:\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.
| Component | Default directory | File name | Controlled by |
|---|---|---|---|
| taosd | /var/log/taos | taosdlog.0, taosdlog.1 | logDir in taos.cfg. See taosd Reference |
| Client | /var/log/taos | taoslogX.Y | logDir in the client taos.cfg. See taosc Reference |
| Slow query log | /var/log/taos | taosslowlog.<year-month-day> | logDir in the client taos.cfg |
| UDF | /var/log/taos | taosudfdlog.*; taospyudf.log | logDir in taos.cfg. See User-Defined Functions (UDF) |
| MQTT subscription | /var/log/taos | taosmqttdlog.* | logDir in taos.cfg. See MQTT Data Subscription |
| Xnode daemon | /var/log/taos | taosxnoded_<instance ID>_<date>.log | logDir in taos.cfg. See Data Ingestion (Xnode) |
| taosAdapter | /var/log/taos | taosadapter_<instance ID>_<date>.log | log.path in taosadapter.toml. See taosAdapter Reference |
| taosKeeper | /var/log/taos | taoskeeper_<instance ID>_<date>.log | log.path in taoskeeper.toml. See taosKeeper Reference |
| taosExplorer | /var/log/taos | taosexplorer_<instance ID>_<date>.log | log.path in explorer.toml. See taosExplorer Reference |
| taosX | /var/log/taos | taosx_<instance ID>_<date>.log | log.path in taosx.toml. See taosX Reference |
| taosX-Agent | /var/log/taos | taosx_agent_<instance ID>_<date>.log | log.path in agent.toml. See Configuration Reference |
| TDgpt (taosanode) | /var/log/taos/taosanode | error.log, access.log, taosanode.app.log | TDgpt configuration file. See Anode Management |
| License center (CLS) | /var/log/taoscls | taoscls.log | file 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
taosshell, runSHOW DNODES;to obtaindnode_id, then runSHOW DNODE <dnode_id> VARIABLES LIKE 'logDir';. You can also check the server configuration file:grep -i '^logDir' /etc/taos/taos.cfg. - Client: In the
taosshell, runSHOW LOCAL VARIABLES LIKE 'logDir';, or inspecttaos.cfgon the client machine. - taosAdapter, taosKeeper, taosExplorer, taosX, and taosX-Agent: Check
pathin the[log]section of the corresponding TOML file. Some components also accept--log.pathor an environment variable, such asTAOS_ADAPTER_LOG_PATHorTAOS_KEEPER_LOG_PATH. Those override the configuration file. - If
taosdwas 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
-
If the problem can be reproduced, raise the log level first.
- Server: run
ALTER ALL DNODES 'debugFlag' '135';, or change one node withALTER DNODE <dnode_id> 'debugFlag' '135';. You can also adddebugFlag 135at the end oftaos.cfgand restarttaosd. - Client: in the
taosshell, runALTER LOCAL 'debugFlag' '135';. This applies only to the current process.
- Server: run
-
Reproduce the problem and note the approximate time.
-
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/taosOn Windows, compress
C:\TDengine\logandC:\TDengine\cfg. If the log directory is large, include only the files modified around the time of the problem. -
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. -
Include the TDengine version, operating system, deployment method, reproduction steps, and the time of the problem. Submit them as described in FAQ and Feedback.
-
After the problem is identified, set the log level back to
131, for exampleALTER ALL DNODES 'debugFlag' '131';. Level135produces a large volume of logs and reduces performance, so do not leave it enabled during normal operation.