Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Commit cea2bc1

Browse files
jsteemannSimran-Bnerpaula
authored
Added startup option --query.log-failed-queries to optionally log all… (#1140)
* Added startup option --query.log-failed-queries to optionally log all failed AQL queries to the server log. The option is turned off by default. * Update programs-arangod-query.md * updated after functionality change * Formatting * add new option * fixed * adjusted for all relevant versions * AE * Review * Release notes Co-authored-by: Simran <[email protected]> Co-authored-by: Simran Spiller <[email protected]> Co-authored-by: Paula Mihu <[email protected]>
1 parent 4f53438 commit cea2bc1

5 files changed

+134
-0
lines changed

3.10/programs-arangod-query.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,42 @@ queries early. When set to *false*, AQL queries that produce warnings will not
130130
abort and return the warnings along with the query results.
131131
The option can also be overridden for each individual AQL query.
132132

133+
## Logging failed AQL queries
134+
135+
<small>Introduced in: v3.9.5, v3.10.2</small>
136+
137+
`--query.log-failed value`
138+
139+
If set to `true`, all failed AQL queries are logged to the server log. This
140+
option can be used during development, or to catch unexpected failed queries
141+
in production.
142+
143+
The option is turned off by default.
144+
145+
## Logging AQL queries with high memory usage
146+
147+
`--query.log-memory-usage-threshold value`
148+
149+
<small>Introduced in: v3.9.5, v3.10.2</small>
150+
151+
This option determines the peak memory usage threshold for AQL queries from
152+
which on a warning is logged if queries exceed it. This is useful for
153+
finding queries that use a large amount of memory.
154+
155+
The default value is `4294967296` (4 GB).
156+
157+
## Controlling length of logged query strings and bind parameter values
158+
159+
<small>Introduced in: v3.9.5, v3.10.2</small>
160+
161+
`--query.max-artifact-log-length value`
162+
163+
This option determines the maximum length of logged query strings and bind parameter
164+
values. This allows truncating overly long query strings and bind parameter values
165+
to a reasonable length in log files.
166+
167+
The default value is `4096` bytes.
168+
133169
## Requiring `WITH` statements
134170

135171
<small>Introduced in: v3.7.12</small>

3.10/release-notes-new-features310.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,19 @@ temporary data:
868868

869869
For more information on the new options, please refer to [ArangoDB Server Pregel Options](programs-arangod-pregel.html).
870870

871+
### AQL query logging
872+
873+
<small>Introduced in: v3.9.5, v3.10.2</small>
874+
875+
There are three new startup options to configure how AQL queries are logged:
876+
877+
- `--query.log-failed` for logging all failed AQL queries, to be used during
878+
development or to catch unexpected failed queries in production (off by default)
879+
- `--query.log-memory-usage-threshold` to define a peak memory threshold from
880+
which on a warning is logged for AQL queries that exceed it (default: 4 GB)
881+
- `--query.max-artifact-log-length` for controlling the length of logged query
882+
strings and bind parameter values. Both are truncated to 4096 bytes by default.
883+
871884
Read from Followers in Clusters (Enterprise Edition)
872885
----------------------------------------------------
873886

3.11/programs-arangod-query.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,42 @@ queries early. When set to *false*, AQL queries that produce warnings will not
130130
abort and return the warnings along with the query results.
131131
The option can also be overridden for each individual AQL query.
132132

133+
## Logging failed AQL queries
134+
135+
<small>Introduced in: v3.9.5, v3.10.2</small>
136+
137+
`--query.log-failed value`
138+
139+
If set to `true`, all failed AQL queries are logged to the server log. This
140+
option can be used during development, or to catch unexpected failed queries
141+
in production.
142+
143+
The option is turned off by default.
144+
145+
## Logging AQL queries with high memory usage
146+
147+
`--query.log-memory-usage-threshold value`
148+
149+
<small>Introduced in: v3.9.5, v3.10.2</small>
150+
151+
This option determines the peak memory usage threshold for AQL queries from
152+
which on a warning is logged if queries exceed it. This is useful for
153+
finding queries that use a large amount of memory.
154+
155+
The default value is `4294967296` (4 GB).
156+
157+
## Controlling length of logged query strings and bind parameter values
158+
159+
<small>Introduced in: v3.9.5, v3.10.2</small>
160+
161+
`--query.max-artifact-log-length value`
162+
163+
This option determines the maximum length of logged query strings and bind parameter
164+
values. This allows truncating overly long query strings and bind parameter values
165+
to a reasonable length in log files.
166+
167+
The default value is `4096` bytes.
168+
133169
## Requiring `WITH` statements
134170

135171
<small>Introduced in: v3.7.12</small>

3.9/programs-arangod-query.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,42 @@ queries early. When set to *false*, AQL queries that produce warnings will not
130130
abort and return the warnings along with the query results.
131131
The option can also be overridden for each individual AQL query.
132132

133+
## Logging failed AQL queries
134+
135+
<small>Introduced in: v3.9.5</small>
136+
137+
`--query.log-failed value`
138+
139+
If set to `true`, all failed AQL queries are logged to the server log. This
140+
option can be used during development, or to catch unexpected failed queries
141+
in production.
142+
143+
The option is turned off by default.
144+
145+
## Logging AQL queries with high memory usage
146+
147+
`--query.log-memory-usage-threshold value`
148+
149+
<small>Introduced in: v3.9.5</small>
150+
151+
This option determines the peak memory usage threshold for AQL queries from
152+
which on a warning is logged if queries exceed it. This is useful for
153+
finding queries that use a large amount of memory.
154+
155+
The default value is `4294967296` (4 GB).
156+
157+
## Controlling length of logged query strings and bind parameter values
158+
159+
<small>Introduced in: v3.9.5</small>
160+
161+
`--query.max-artifact-log-length value`
162+
163+
This option determines the maximum length of logged query strings and bind parameter
164+
values. This allows truncating overly long query strings and bind parameter values
165+
to a reasonable length in log files.
166+
167+
The default value is `4096` bytes.
168+
133169
## Requiring `WITH` statements
134170

135171
<small>Introduced in: v3.7.12</small>

3.9/release-notes-new-features39.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,19 @@ A pseudo log topic `"all"` was added. Setting the log level for the "all" log
569569
topic will adjust the log level for **all existing log topics**. For example,
570570
`--log.level all=debug` will set all log topics to log level "debug".
571571

572+
### AQL query logging
573+
574+
<small>Introduced in: v3.9.5</small>
575+
576+
There are three new startup options to configure how AQL queries are logged:
577+
578+
- `--query.log-failed` for logging all failed AQL queries, to be used during
579+
development or to catch unexpected failed queries in production (off by default)
580+
- `--query.log-memory-usage-threshold` to define a peak memory threshold from
581+
which on a warning is logged for AQL queries that exceed it (default: 4 GB)
582+
- `--query.max-artifact-log-length` for controlling the length of logged query
583+
strings and bind parameter values. Both are truncated to 4096 bytes by default.
584+
572585
Overload control
573586
----------------
574587

0 commit comments

Comments
 (0)