Logging target must be explicitly defined.
Whether the log-file should be written to the filesystem or to shared memory must now be explicitly defined when calling skygw_logmanager_init() (instead of passing that via the argc/argv construct). Also, the meaning of '-l' when invoking maxscale has been changed. Earlier -l [file|shm] specified whether the trace and debug logs should be written to shared memory (while the error and message logs always were written to the filesystem) and the _default_ was to write them to shared memory. Now, with only one file, '-l' has still the same meaning, but it decides whether the one and only logfile should be written to shared memory, or the filesystem and the _default_ is to write it to the filesystem.
This commit is contained in:
@ -42,7 +42,6 @@ typedef enum
|
||||
LOGFILE_LAST = LOGFILE_DEBUG
|
||||
} logfile_id_t;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
FILEWRITER_INIT,
|
||||
@ -50,6 +49,13 @@ typedef enum
|
||||
FILEWRITER_DONE
|
||||
} filewriter_state_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
LOG_TARGET_DEFAULT = 0,
|
||||
LOG_TARGET_FS = 1, // File system
|
||||
LOG_TARGET_SHMEM = 2, // Shared memory
|
||||
} log_target_t;
|
||||
|
||||
/**
|
||||
* Thread-specific logging information.
|
||||
*/
|
||||
@ -145,7 +151,7 @@ int mxs_log_rotate();
|
||||
int mxs_log_enable_priority(int priority);
|
||||
int mxs_log_disable_priority(int priority);
|
||||
|
||||
bool skygw_logmanager_init(const char* logdir, int argc, char* argv[]);
|
||||
bool skygw_logmanager_init(const char* logdir, log_target_t target, int argc, char* argv[]);
|
||||
void skygw_logmanager_done(void);
|
||||
void skygw_logmanager_exit(void);
|
||||
|
||||
|
Reference in New Issue
Block a user