MXS-2457 Streamline logging

This commit is contained in:
Johan Wikman 2019-05-03 10:49:03 +03:00
parent 279edce16e
commit a3cf1d22c0
3 changed files with 14 additions and 21 deletions

View File

@ -1321,6 +1321,11 @@ bool qc_set_cache_properties(const QC_CACHE_PROPERTIES* properties)
if (properties->max_size >= 0)
{
if (properties->max_size == 0)
{
MXS_NOTICE("Query classifier cache disabled.");
}
this_unit.set_cache_max_size(properties->max_size);
rv = true;
}

View File

@ -1287,24 +1287,18 @@ Dbfw* Dbfw::create(const char* zName, MXS_CONFIG_PARAMETER* pParams)
{
if (rval->treat_string_as_field() || rval->treat_string_arg_as_field())
{
MXS_NOTICE("The parameter 'treat_string_arg_as_field' and/or "
"'treat_string_as_field' is enabled for %s. "
"As a consequence, the query classifier cache must be disabled.",
zName);
QC_CACHE_PROPERTIES cache_properties;
qc_get_cache_properties(&cache_properties);
if (cache_properties.max_size != 0)
{
MXS_NOTICE("The parameter 'treat_string_arg_as_field' or(and) "
"'treat_string_as_field' is enabled for %s, "
"disabling the query classifier cache.",
zName);
cache_properties.max_size = 0;
qc_set_cache_properties(&cache_properties);
MXS_NOTICE("Query classifier cache disabled.");
}
else
{
MXS_NOTICE("The query classifier cache was disabled already.");
}
}
}

View File

@ -188,23 +188,17 @@ MaskingFilter* MaskingFilter::create(const char* zName, MXS_CONFIG_PARAMETER* pP
if (config.treat_string_arg_as_field())
{
MXS_NOTICE("The parameter 'treat_string_arg_as_field' is enabled for %s. "
"As a consequence, the query classifier cache must be disabled.",
zName);
QC_CACHE_PROPERTIES cache_properties;
qc_get_cache_properties(&cache_properties);
if (cache_properties.max_size != 0)
{
MXS_NOTICE("The parameter 'treat_string_arg_as_field' is enabled for %s, "
"disabling the query classifier cache.",
zName);
cache_properties.max_size = 0;
qc_set_cache_properties(&cache_properties);
MXS_NOTICE("Query classifier cache disabled.");
}
else
{
MXS_NOTICE("The query classifier cache was disabled already.");
}
}
}