7.2. Trace configuration items
The following are the configuration items available for trace configuration.
Some configuration items apply to both trace types (database and services), others are specific to a type.
The applicable types are listed under Trace type in each configuration item section.
The configuration items are listed in order of first appearance in the example fbtrace.conf.
7.2.1. enabled
Enables tracing.
Trace typedatabase, services
Syntax
enabled = Boolean
Defaultfalse
7.2.2. log_filename
Path of trace log file (system trace only).
Trace typedatabase, services
Syntax
log_filename = path
path is the absolute or relative path of the log file. This configuration item is only available for system trace configuration.
A backslash must be escaped as \\, or — on Windows — you can also use / as the path separator.
For database sections, regular expression references (sed-like) for substitutions based on the matched pattern (simple value of the section) are supported.
\0 — whole matched string, \1 … \9 — regular expression groups (parenthesized subexpressions).
See alsoSection 7.2.3, “max_log_size”
7.2.3. max_log_size
Maximum size of log files (in megabytes).
Trace typedatabase, services
Syntax
max_log_size = integer
UnitMegabyte (MiB)
Default0 (unlimited)
When the maximum log file size is reached, the log is rotated by renaming it to include the current date and time.
A new log file with the name configured by Section 7.2.2, “log_filename” is created.
A value of 0 (zero, the default) means that the file size is unlimited, and no rotation will occur.
This configuration item is only available for system trace configuration.
For limiting user trace sizes, specify Section 3.1.8, “MaxUserTraceLogSize” in firebird.conf.
See alsoSection 7.2.2, “log_filename”, Section 3.1.8, “MaxUserTraceLogSize”
7.2.4. include_filter
Pattern for inclusion of trace events in a trace.
Trace typedatabase, services
Syntax
include_filter = [ <sql-regular-expression> ]
<sql-regular-expression> ::=
!! See Syntax: SQL Regular Expressions !!
What is matched depends on the trace type:
|
|
Statement text of a query-related event. |
|
|
Service name of a service-operation-related event. Supported service names
|
Other event types are not subject to inclusion or exclusion.
See alsoSection 7.2.5, “exclude_filter”
7.2.5. exclude_filter
Pattern for exclusion of trace events in a trace.
Trace typedatabase, services
Syntax
include_filter = [ <sql-regular-expression> ]
<sql-regular-expression> ::=
!! See Syntax: SQL Regular Expressions !!
What is matched depends on the trace type:
|
|
Statement text of a query-related event. |
|
|
Service name of a service-operation-related event. |
Other event types are not subject to inclusion or exclusion.
See alsoSection 7.2.4, “include_filter”
7.2.6. log_connections
Enables logging of database attach and detach events.
Trace typedatabase
Syntax
log_connections = Boolean
Defaultfalse
See alsoSection 7.2.42, “log_services”
7.2.7. connection_id
Limits the trace to a specific connection.
Trace typedatabase
Syntax
connection_id = integer
Default0 (all connections)
The value 0 (zero, the default) traces all connections.
A non-zero value traces the connection with that specific connection id.
The connection id is the value reported by — for example — CURRENT_CONNECTION, and in column MON$ATTACHMENT_ID of MON$ATTACHMENTS.
It’s not possible to specify multiple connection ids.
7.2.8. log_transactions
Log start and end of transactions.
Trace typedatabase
Syntax
log_transactions = Boolean
Defaultfalse
7.2.9. log_statement_prepare
Log statement prepare.
Trace typedatabase
Syntax
log_statement_prepare = Boolean
Defaultfalse
See alsoSection 7.2.29, “print_plan”, Section 7.2.37, “max_sql_length”
7.2.10. log_statement_free
Log statement free (close cursor, unprepare statement, drop statement handle).
Trace typedatabase
Syntax
log_statement_free = Boolean
Defaultfalse
7.2.11. log_statement_start
Log statement execution start.
Trace typedatabase
Syntax
log_statement_start = Boolean
Defaultfalse
7.2.12. log_statement_finish
Log statement execution finish.
Trace typedatabase
Syntax
log_statement_finish = Boolean
Defaultfalse
For statements with a cursor (e.g. SELECT), a statement is only finished when the last record has been fetched or the cursor is closed.
See alsoSection 7.2.36, “time_threshold”
7.2.13. log_procedure_compile
Log procedure compilation.
Trace typedatabase
|
Added |
5.0 |
Syntax
log_procedure_compile = Boolean
Defaultfalse
7.2.14. log_procedure_start
Log procedure execution start.
Trace typedatabase
Syntax
log_procedure_start = Boolean
Defaultfalse
7.2.15. log_procedure_finish
Log procedure execution finish.
Trace typedatabase
Syntax
log_procedure_finish = Boolean
Defaultfalse
See alsoSection 7.2.36, “time_threshold”
7.2.16. log_function_compile
Log function compilation.
Trace typedatabase
|
Added |
5.0 |
Syntax
log_function_compile = Boolean
Defaultfalse
7.2.17. log_function_start
Log function execution start.
Trace typedatabase
Syntax
log_function_start = Boolean
Defaultfalse
7.2.18. log_function_finish
Log function execution finish.
Trace typedatabase
Syntax
log_function_finish = Boolean
Defaultfalse
See alsoSection 7.2.36, “time_threshold”
7.2.19. log_trigger_compile
Log trigger compilation.
Trace typedatabase
|
Added |
5.0 |
Syntax
log_trigger_compile = Boolean
Defaultfalse
7.2.20. log_trigger_start
Log trigger execution start.
Trace typedatabase
Syntax
log_trigger_start = Boolean
Defaultfalse
7.2.21. log_trigger_finish
Log trigger execution finish.
Trace typedatabase
Syntax
log_trigger_finish = Boolean
Defaultfalse
See alsoSection 7.2.36, “time_threshold”
7.2.22. log_context
Log context variable change (through RDB$SET_CONTEXT).
Trace typedatabase
Syntax
log_context = Boolean
Defaultfalse
7.2.23. log_errors
Log errors.
Trace typedatabase, services
Syntax
log_errors = Boolean
Defaultfalse
See alsoSection 7.2.24, “log_warnings”, Section 7.2.25, “include_gds_codes”, Section 7.2.26, “exclude_gds_codes”
7.2.24. log_warnings
Log warnings.
Trace typedatabase, services
Syntax
log_warnings = Boolean
Defaultfalse
See alsoSection 7.2.23, “log_errors”, Section 7.2.25, “include_gds_codes”, Section 7.2.26, “exclude_gds_codes”
7.2.25. include_gds_codes
List of GDS codes of errors and warnings to include in trace.
Trace typedatabase, services
Syntax
include_gds_codes = [<error> [ ',' <error> ]... ]
<error> ::= <gdscode> | <gdscode-symbol>
<gdscode> ::= integer
!! see column GDSCODE in SQLCODE and GDSCODE Error Codes and Descriptions !!
!! This table only contains Firebird errors with a symbol !!
<gdscode-symbol> ::= string
!! see column Symbol in SQLCODE and GDSCODE Error Codes and Descriptions !!
DefaultEmpty (include all errors and warnings)
If include_gds_codes is not set or set to empty, all errors and warnings — not excluded by Section 7.2.26, “exclude_gds_codes” — are logged.
If include_gds_codes is non-empty, only errors or warnings that contain one of the specified GDS codes in their status vector will be logged.
Example
# Include deadlock (335544336), req_sync (335544364), and 335544321 (arith_except)
include_gds_codes = deadlock, req_sync, 335544321
See alsoSection 7.2.23, “log_errors”, Section 7.2.24, “log_warnings”, Section 7.2.26, “exclude_gds_codes”, SQLCODE and GDSCODE Error Codes and Descriptions
7.2.26. exclude_gds_codes
List of GDS codes of errors and warnings to exclude from trace.
Trace typedatabase, services
Syntax
exclude_gds_codes = [<error> [ ',' <error> ]... ]
<error> ::= <gdscode> | <gdscode-symbol>
<gdscode> ::= integer
!! see column GDSCODE in SQLCODE and GDSCODE Error Codes and Descriptions !!
!! This table only contains Firebird errors with a symbol !!
<gdscode-symbol> ::= string
!! see column Symbol in SQLCODE and GDSCODE Error Codes and Descriptions !!
DefaultEmpty (do not exclude any error or warning)
If exclude_gds_codes is not set or set to empty, no errors or warnings are excluded — though Section 7.2.25, “include_gds_codes” can apply its own restrictions.
If exclude_gds_codes is non-empty, any error or warning that contains one of the specified GDS codes in their status vector will not be logged.
Example
# Exclude deadlock (335544336), req_sync (335544364), and 335544321 (arith_except)
exclude_gds_codes = deadlock, req_sync, 335544321
See alsoSection 7.2.23, “log_errors”, Section 7.2.24, “log_warnings”, Section 7.2.25, “include_gds_codes”, SQLCODE and GDSCODE Error Codes and Descriptions
7.2.27. log_initfini
Log trace session init (start) and finish.
Trace typedatabase, services
Syntax
log_initfini = Boolean
Defaultfalse
7.2.28. log_sweep
Log sweep activity.
Trace typedatabase
Syntax
log_sweep = Boolean
Defaultfalse
7.2.29. print_plan
Print access path (plan) with SQL statement.
Trace typedatabase
Syntax
print_plan = Boolean
Defaultfalse
The type of plan — legacy or explained — can be controlled with Section 7.2.30, “explain_plan”.
See alsoSection 7.2.9, “log_statement_prepare”, Section 7.2.30, “explain_plan”
7.2.30. explain_plan
Print legacy plan (false) or explained plan (true).
Trace typedatabase
Syntax
explain_plan = Boolean
Defaultfalse (legacy plan)
This setting only has effect when Section 7.2.29, “print_plan” is enabled.
See alsoSection 7.2.29, “print_plan”
7.2.31. print_perf
Print detailed performance info when applicable.
Trace typedatabase
Syntax
print_perf = Boolean
Defaultfalse
7.2.32. log_blr_requests
Log BLR (Binary Language Representation) compilation and execution.
Trace typedatabase
Syntax
log_blr_requests = Boolean
Defaultfalse
See alsoSection 7.2.33, “print_blr”
7.2.33. print_blr
Print BLR (Binary Language Representation) requests.
Trace typedatabase
Syntax
print_blr = Boolean
Defaultfalse
See alsoSection 7.2.32, “log_blr_requests”, Section 7.2.38, “max_blr_length”
7.2.34. log_dyn_requests
Log dyn compilation and execution.
Trace typedatabase
Syntax
log_dyn_requests = Boolean
Defaultfalse
See alsoSection 7.2.35, “print_dyn”
7.2.35. print_dyn
Print dyn requests.
Trace typedatabase
Syntax
print_dyn = Boolean
Defaultfalse
See alsoSection 7.2.34, “log_dyn_requests”, Section 7.2.39, “max_dyn_length”
7.2.36. time_threshold
Only logs XXX_finish events if their timing exceeds the threshold.
Trace typedatabase
Syntax
time_threshold = integer
UnitMillisecond
Default100 (100 milliseconds)
See alsoSection 7.2.12, “log_statement_finish”, Section 7.2.15, “log_procedure_finish”, Section 7.2.18, “log_function_finish”, Section 7.2.21, “log_trigger_finish”
7.2.37. max_sql_length
Maximum length of SQL strings in a log record.
Trace typedatabase
Syntax
max_sql_length = integer
UnitByte
Default300
Beware when adjusting max_XXX parameters!
The maximum length of a log record for one event should not exceed 64KiB.
7.2.38. max_blr_length
Maximum length of BLR (Binary Language Representation) in a log record.
Trace typedatabase
Syntax
max_blr_length = integer
UnitByte
Default500
Beware when adjusting max_XXX parameters!
The maximum length of a log record for one event should not exceed 64KiB.
See alsoSection 7.2.33, “print_blr”
7.2.39. max_dyn_length
Maximum length of dyn in a log record.
Trace typedatabase
Syntax
max_dyn_length = integer
UnitByte
Default500
Beware when adjusting max_XXX parameters!
The maximum length of a log record for one event should not exceed 64KiB.
See alsoSection 7.2.35, “print_dyn”
7.2.40. max_arg_length
Maximum length of an individual string argument in a log record.
Trace typedatabase
Syntax
max_arg_length = integer
UnitByte
Default80
Beware when adjusting max_XXX parameters!
The maximum length of a log record for one event should not exceed 64KiB.
See alsoSection 7.2.11, “log_statement_start”, Section 7.2.41, “max_arg_count”
7.2.41. max_arg_count
Maximum number of query arguments in a log record.
Trace typedatabase
Syntax
max_arg_count = integer
UnitArgument (parameter)
Default30
Beware when adjusting max_XXX parameters!
The maximum length of a log record for one event should not exceed 64KiB.
See alsoSection 7.2.11, “log_statement_start”, Section 7.2.40, “max_arg_length”
7.2.42. log_services
Enables logging of service attach, detach, and start events.
Trace typeservices
Syntax
log_services = Boolean
Defaultfalse
See alsoSection 7.2.6, “log_connections”
7.2.43. log_service_query
Enables logging of service query events.
Trace typeservices
Syntax
log_service_query = Boolean
Defaultfalse