Augmentation moved to skygw_log_write_context. The severity prefix
will be added there as well. If all is done on that level, the
amount of memory needed can be figured out in one go. No need to
allocate and copy the message several times.
This commit is only to introduce new logging macros.
The current implementation is such that a statement like:
MAXSCALE_NOTICE("Refreshing configuration following SIGHUP\n");
is equivalent with
LOGIF(LM, (skygw_log_write(
LOGFILE_MESSAGE,
"Refreshing configuration following SIGHUP\n")));
The actual implementation will later be changed as the logging
mechanism itself is changed.
The names of the macros are now according to the levels of syslog
and currently the mapping is like:
MAXSCALE_ERROR (Syslog LOG_ERR) -> LOGFILE_ERROR
MAXSCALE_WARNING (Syslog LOG_WARNING) -> LOGFILE_ERROR
MAXSCALE_NOTICE (Syslof LOG_NOTICE) -> LOGFILE_MESSAGE
MAXSCALE_INFO (Syslog LOG_INFO) -> LOGFILE_TRACE
MAXSCALE_DEBUG (Syslog LOG_DEBUG) -> LOGFILE_DEBUG
When log manager is changed to deal "natively" with syslog levels
this mapping will disappear of course.
Template config file is copied as maxscale.cnf if no configuration file is found.
If /etc/maxscale.cnf is not found, the /etc/maxscale.cnf.template will be copied as /etc/maxscale.cnf.
This allows MaxScale to start right after installation if combined with a running and properly configured server.
Straightforward indentation and whitespace modifications.
This is the first one in a series of commits that will bring
log manager in line with the coding style.
Before these changes when max_sescmd_history was used the session
was closed when the limit was exceeded. With this change, when the
limit is exceeded the recovery of slaves and the session command history
are both disabled. This will allow the sessions to continue while still
keeping the old functionality of limited salve replacement.
The disable_sescmd_history and disable_slave_recovery parameters were combined
so that disabling the session command history will also disable slave recovery.
This way no harm can be done with disable_sescmd_history.
routeQuery calls route_single_stmt, which requires the GWBUF to be
contiguous. Earlier it was made contiguous (if needed) in
route_single_stmt. However, since the process of making a GWBUF
contiguous causes the original buffer to be freed, this would lead
to a double free later in routeQuery that frees the passed buffer.
This is prevented now by making the buffer contiguous before calling
route_single_stmt.