Enabled printing this also in Release version:
raatikka@linux-yxkl:~/bin/develop/bin> ./maxscale -d -c ../
Info : MaxScale will be run in the terminal process.
Using Home directory command-line argument as MAXSCALE_HOME = /home/raatikka/bin/develop
Error log : /home/raatikka/bin/develop/log/skygw_err1.log
Message log : /home/raatikka/bin/develop/log/skygw_msg1.log
Trace log : /home/raatikka/bin/develop/log/skygw_trace1.log->/dev/shm/7886/skygw_trace1.log
Debug log : /home/raatikka/bin/develop/log/skygw_debug1.log->/dev/shm/7886/skygw_debug1.log
Home directory : /home/raatikka/bin/develop
Configuration file : /home/raatikka/bin/develop/etc/MaxScale.cnf
Log directory : /home/raatikka/bin/develop/log
Data directory : /home/raatikka/bin/develop/data/data7886
That is, all log files' names and locations are printed on the screen.
When MaxScale starts it opens log file of each type and if there exist log files of same types in the same directory, it will try to reuse the file with largest sequence number in it. If there are no existing files, a file name with sequence number 1 will be created. If the file with largest sequence number is not writable, a new log file with larger sequence number will be created.
void session_enable_log(SESSION* ses, logfile_id_t id)
and
void session_disable_log(SESSION* ses, logfile_id_t id)
Which switch specific log type on/off if the log type in question is not generally enabled.
Each thread carries a thread-specific struct log_info_t which includes members for current session id and bitfield for enabled log types for the current session. That information is checked before actual log write functions are called.
Each file where session-specific logging is used, must include the following exports:
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
log_manager.cc:
Log manager handles cases where there are mismatch in user privileges.
Mark log files enabled in the global lm_enabled_logfiles_bitmask after initialization so that it reflects reality in error cases. In general, take into account the possibility that any phase in initialization may fail and read return values.
Replaced file_exists_and_is_writable to check_file_and_path which has a slightly different logic and which detects if file open fails for a few different reasons.
Improved logging (in stderr) in general in error cases.
gateway.c: Also check home directory accessibility in case when it is provided as a command-line argument. Added function check_dir_access to provide that function. Read return value of skysql_logmanager_init and exit (nicely) if it failed.
skygw_utils.cc: initialize mlist with version number 2, which indicates that object is initialized (different than zero) and that there are no active updates on the object (version%2==0).
Client flags are now copied to each backend and used in their connections.
log_manager.cc: fixed string allocation where one byte was missing.
mysql_client.c: fixed string allocation where one byte was missing.