MySQL 8.3.0
Source Code Documentation
log_builtins_filter_imp.h File Reference

Go to the source code of this file.

Classes

class  log_builtins_filter_imp
 
class  log_builtins_filter_debug_imp
 

Functions

int log_builtins_filter_exit ()
 Deinitialize filtering engine. More...
 
int log_builtins_filter_init ()
 Initialize filtering engine. More...
 
int log_builtins_filter_run (log_filter_ruleset *ruleset, log_line *ll)
 Apply all matching rules from a filter rule set to a given log line. More...
 
int log_builtins_filter_update_verbosity (int verbosity)
 This is part of the 5.7 emulation: If –log_error_verbosity is changed, we generate an artificial filter rule from it here. More...
 
int log_builtins_filter_parse_suppression_list (char *list, bool update)
 @global.log_error_suppression_list accepts a comma-separated list of error-codes that should not be included in the error-log. More...
 

Function Documentation

◆ log_builtins_filter_exit()

int log_builtins_filter_exit ( )

Deinitialize filtering engine.

Returns
0 Success!
-1 De-initialize? Filter wasn't even initialized!
Return values
0Success!
-1De-initialize? Filter wasn't even initialized!

◆ log_builtins_filter_init()

int log_builtins_filter_init ( )

Initialize filtering engine.

We need to do this early, before the component system is up.

Returns
0 Success!
-1 Couldn't initialize ruleset lock
-2 Filter was already initialized?

We need to do this early, before the component system is up.

Return values
0Success!
-1Couldn't initialize ruleset
-2Filter was already initialized?

◆ log_builtins_filter_parse_suppression_list()

int log_builtins_filter_parse_suppression_list ( char *  list,
bool  update 
)

@global.log_error_suppression_list accepts a comma-separated list of error-codes that should not be included in the error-log.

Events with a severity of System or Error can not be filtered in this way and will always be forwarded to the log-sinks.

This provides simple filtering for cases where the flexibility of the loadable filter-language is not needed. (The same engine is used however, just with a more limited interface.)

For this filtering to be active, @global.log_error_services has to feature "log_filter_internal", as it does by default. When that is the case, one or both of log_error_verbosity and this variable may be used. Only one of "log_filter_internal" and "log_filter_dragnet" should be used at a time.

The semantics follow that of our system variables; that is to say, when called with update==false, the function acts as a check-function that validates the entire list given to it; when called with update==true, it creates filter-rules from the list items. This way, we either create all rules, or no rules, rather than ending up with an incomplete rule-set when we encounter a problem in the input.

The return value encodes the location in the argument where the failure occurred, like so:

  • if 0 is returned, no issues were detected
  • if a value less than zero is returned, -(retval + 1) is the byte position (counting from 0) in the list argument at which point the failure was detected
Parameters
listlist of error-codes that should not appear in the error-log
updatefalse: verify list only true: create filtering rules from suppression list
Return values
0success
!0failure (see above)

◆ log_builtins_filter_run()

int log_builtins_filter_run ( log_filter_ruleset ruleset,
log_line ll 
)

Apply all matching rules from a filter rule set to a given log line.

Parameters
rulesetrule-set to apply
llthe current log line
Return values
intnumber of matched rules

◆ log_builtins_filter_update_verbosity()

int log_builtins_filter_update_verbosity ( int  verbosity)

This is part of the 5.7 emulation: If –log_error_verbosity is changed, we generate an artificial filter rule from it here.

For this filtering to be active, @global.log_error_services has to feature "log_filter_internal", as it does by default. When that is the case, one or both of log_error_verbosity and log_error_suppression_list (see below) may be used. Only one of "log_filter_internal" and "log_filter_dragnet" should be used at a time.

Parameters
verbositylog_error_verbosity style, range(1,3) 1:errors, 2:+=warnings, 3:+=notes
Return values
0success
!0failure