Remove log_to_shm

The feature was removed in 2.3 and was ignored if configured.
This commit is contained in:
Markus Mäkelä 2019-05-06 08:58:39 +03:00
parent 20a7170024
commit 5ac24de6b0
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
7 changed files with 8 additions and 29 deletions

View File

@ -484,12 +484,12 @@ disable use the value 0.
#### `log_to_shm`
**Note:** This parameter is deprecated and it is ignored by MaxScale versions
2.3.0 and newer. If you want to store the log in shared memory, define the
directory with `logdir` in `/dev/shm`.
**Note:** This parameter has been removed in 2.4.0: do not use it
In older MaxScale versions, the actual log file was created in `/dev/shm` and a
symbolic link to that file was stored in place of the normal MaxScale log.
In older MaxScale versions, the actual log file was created in `/dev/shm` and
a symbolic link to that file was stored in place of the normal MaxScale log.
If you want to store the log in shared memory, define the directory with
`logdir` in `/dev/shm`.
#### `log_warning`

View File

@ -312,8 +312,7 @@ location where the log files are stored.
"log_warning": true,
"log_notice": true,
"log_info": true,
"log_debug": false,
"log_to_shm": false
"log_debug": false
},
"log_file": "/home/markusjm/build/log/maxscale/maxscale.log",
"log_priorities": [
@ -336,8 +335,7 @@ PATCH /v1/maxscale/logs
```
Update logging parameters. The request body must define updated values for the
`data.attributes.parameters` object. All logging parameters apart from
`log_to_shm` can be altered at runtime.
`data.attributes.parameters` object. All logging parameters can be altered at runtime.
#### Response

View File

@ -224,7 +224,6 @@ extern const char CN_MODULE_CONFIGDIR[];
extern const char CN_SYSLOG[];
extern const char CN_MAXLOG[];
extern const char CN_LOG_AUGMENTATION[];
extern const char CN_LOG_TO_SHM[];
namespace maxscale
{

View File

@ -1,7 +1,6 @@
[maxscale]
threads=###threads###
log_warning=1
log_to_shm=1
log_debug=1
[MySQL-Monitor]

View File

@ -216,7 +216,6 @@ extern const char CN_MODULE_CONFIGDIR[] = "module_configdir";
extern const char CN_SYSLOG[] = "syslog";
extern const char CN_MAXLOG[] = "maxlog";
extern const char CN_LOG_AUGMENTATION[] = "log_augmentation";
extern const char CN_LOG_TO_SHM[] = "log_to_shm";
typedef struct duplicate_context
{
@ -738,7 +737,6 @@ const char* config_pre_parse_global_params[] =
CN_SYSLOG,
CN_MAXLOG,
CN_LOG_AUGMENTATION,
CN_LOG_TO_SHM,
CN_SUBSTITUTE_VARIABLES,
NULL
};

View File

@ -148,7 +148,6 @@ static struct option long_options[] =
static bool syslog_configured = false;
static bool maxlog_configured = false;
static bool log_to_shm_configured = false;
static volatile sig_atomic_t last_signal = 0;
static bool unload_modules_at_exit = true;
static std::string redirect_output_to;
@ -1531,12 +1530,6 @@ int main(int argc, char** argv)
{
cnf->log_target = MXB_LOG_TARGET_FS;
}
else if (strncasecmp(optarg, "shm", PATH_MAX) == 0)
{
// Removed in 2.3
cnf->log_target = MXB_LOG_TARGET_FS;
fprintf(stderr, "Warning: Use of `--log=shm` is deprecated. Data will be logged to file.\n");
}
else if (strncasecmp(optarg, "stdout", PATH_MAX) == 0)
{
cnf->log_target = MXB_LOG_TARGET_STDOUT;
@ -2847,13 +2840,6 @@ static int cnf_preparser(void* data, const char* section, const char* name, cons
{
set_log_augmentation(value);
}
else if (strcmp(name, CN_LOG_TO_SHM) == 0)
{
fprintf(stderr,
"Warning: '%s' has been removed in MaxScale 2.3.0 "
"and will be ignored\n",
CN_LOG_TO_SHM);
}
else if (strcmp(name, CN_SUBSTITUTE_VARIABLES) == 0)
{
cnf->substitute_variables = config_truth_value(value);

View File

@ -122,7 +122,6 @@ json_t* mxs_logs_to_json(const char* host)
json_object_set_new(param, "log_notice", json_boolean(mxb_log_is_priority_enabled(LOG_NOTICE)));
json_object_set_new(param, "log_info", json_boolean(mxb_log_is_priority_enabled(LOG_INFO)));
json_object_set_new(param, "log_debug", json_boolean(mxb_log_is_priority_enabled(LOG_DEBUG)));
json_object_set_new(param, "log_to_shm", json_boolean(false));
json_t* attr = json_object();
json_object_set_new(attr, CN_PARAMETERS, param);
@ -150,4 +149,4 @@ bool mxs_log_rotate()
int mxs_get_log_rotation_count()
{
return this_unit.rotation_count.load(std::memory_order_relaxed);
}
}