Skip to content

Commit d27c6b2

Browse files
keharperGitHub Enterprise
authored andcommitted
Merge pull request #1576 from AdobeDocs/add-query-logging-storage-info
Add information about where query logging is stored
2 parents b1bcfd0 + 8c4329f commit d27c6b2

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

help/configuration/cli/enable-logging.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,23 @@ By default, Commerce writes to the debug log (`<install_directory>/var/log/debug
4848

4949
By default, Commerce writes database activity logs to the `<install-dir>/var/debug/db.log` file.
5050

51+
### Query logging storage location
52+
53+
When database logging is enabled, Commerce stores query logs in the following location:
54+
55+
- **Query log file**: `<install-directory>/var/debug/db.log`
56+
- **Log directory**: `<install-directory>/var/debug/`
57+
58+
The query log contains:
59+
- SQL queries executed by the application
60+
- Query execution times
61+
- Query parameters and bindings
62+
- Database connection information
63+
64+
>[!NOTE]
65+
>
66+
>The query log file can grow large quickly in high-traffic environments. Monitor disk space and consider implementing log rotation or periodic cleanup of the query log file.
67+
5168
### To enable database logging
5269

5370
1. Use the `dev:query-log` command to enable or disable database logging.
@@ -66,6 +83,24 @@ By default, Commerce writes database activity logs to the `<install-dir>/var/deb
6683
bin/magento cache:flush
6784
```
6885

86+
### To view query logs
87+
88+
You can view the query logs using standard file viewing commands:
89+
90+
```bash
91+
# View the entire query log
92+
cat var/debug/db.log
93+
94+
# View the last 100 lines of the query log
95+
tail -n 100 var/debug/db.log
96+
97+
# Monitor the query log in real-time
98+
tail -f var/debug/db.log
99+
100+
# Search for specific queries
101+
grep "SELECT" var/debug/db.log
102+
```
103+
69104
## Cron logging
70105

71106
With the release of version 2.3.1, Commerce now creates a separate `cron` log. \
@@ -108,4 +143,4 @@ Logging to `syslog` is disabled by default.
108143

109144
```bash
110145
bin/magento cache:flush
111-
```
146+
```

0 commit comments

Comments
 (0)