log_manager.cc
Added new argument '-s' which takes additional argument composed of list of logfile identifiers. Logfiles listed with '-s' will be written on main memory instead of disk. In practice, the log file in question will be written in /dev/shm but corresponding symlink is added to log directory. In the case of name conflicts with log files and links, a differentiating sequence number is included in hte name of the file. This, however, is done only when existing file is not writable or is of different type (symlink <> file). Added new logfile LOGFILE_DEBUG whose contents will be largerly what was included up to date in trace log. Disabled feature which spreads writes to log files to others because of bug (#338) in the way block buffers are managed. Changed log manager parameters to match with the current implementation. List of arguments: "-h - help\n" "-a <debug prefix> ............(\"skygw_debug\")\n" "-b <debug suffix> ............(\".log\")\n" "-c <trace prefix> ............(\"skygw_trace\")\n" "-d <trace suffix> ............(\".log\")\n" "-e <message prefix> ............(\"skygw_msg\")\n" "-f <message suffix> ............(\".log\")\n" "-g <error prefix> ............(\"skygw_err\")\n" "-i <error suffix> ............(\".log\")\n" "-j <log path> ............(\"/tmp\")\n" "-s <shmem log file ids> ........(no default)\n"; dcb.c dcb_add_to_zombieslist, add dcb to the front of zombies list instead of inserting to the end of it. gateway.c Renamed shutdown_gateway to shutdown_server (Bug #131) Call skygw_logmanager_init so that trace and debug logs are written to shared memory. poll.c dcb.h Removed some dead code and references to unneeded mutexes. debugcmd.c Added enable/disable log command for debug log. skygw_utils.cc skygw_file_init now takes optional symlink name as a second argument. Symlink is created to point to the file being created.
This commit is contained in:
@ -114,7 +114,7 @@ struct subcommand showoptions[] = {
|
||||
{0, 0, 0} }
|
||||
};
|
||||
|
||||
extern void shutdown_gateway();
|
||||
extern void shutdown_maxscale();
|
||||
static void shutdown_service(DCB *dcb, SERVICE *service);
|
||||
static void shutdown_monitor(DCB *dcb, MONITOR *monitor);
|
||||
|
||||
@ -122,16 +122,37 @@ static void shutdown_monitor(DCB *dcb, MONITOR *monitor);
|
||||
* The subcommands of the shutdown command
|
||||
*/
|
||||
struct subcommand shutdownoptions[] = {
|
||||
{ "maxscale", 0, shutdown_gateway, "Shutdown the MaxScale gateway",
|
||||
{0, 0, 0} },
|
||||
{ "monitor", 1, shutdown_monitor, "Shutdown a monitor, e.g. shutdown monitor 0x48381e0",
|
||||
{ARG_TYPE_ADDRESS, 0, 0} },
|
||||
{ "service", 1, shutdown_service, "Shutdown a service, e.g. shutdown service 0x4838320",
|
||||
{ARG_TYPE_ADDRESS, 0, 0} },
|
||||
{ NULL, 0, NULL, NULL,
|
||||
{0, 0, 0} }
|
||||
{ "maxscale",
|
||||
0,
|
||||
shutdown_maxscale,
|
||||
"Shutdown MaxScale",
|
||||
|
||||
{0, 0, 0}
|
||||
},
|
||||
{
|
||||
"monitor",
|
||||
1,
|
||||
shutdown_monitor,
|
||||
"Shutdown a monitor, e.g. shutdown monitor 0x48381e0",
|
||||
{ARG_TYPE_ADDRESS, 0, 0}
|
||||
},
|
||||
{
|
||||
"service",
|
||||
1,
|
||||
shutdown_service,
|
||||
"Shutdown a service, e.g. shutdown service 0x4838320",
|
||||
{ARG_TYPE_ADDRESS, 0, 0}
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
{0, 0, 0}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static void restart_service(DCB *dcb, SERVICE *service);
|
||||
static void restart_monitor(DCB *dcb, MONITOR *monitor);
|
||||
/**
|
||||
@ -216,8 +237,8 @@ struct subcommand disableoptions[] = {
|
||||
"log",
|
||||
1,
|
||||
disable_log_action,
|
||||
"Disable Log for MaxScale, Options: trace | error | message E.g. "
|
||||
"disable log trace",
|
||||
"Disable Log for MaxScale, Options: debug | trace | error | message "
|
||||
"E.g. disable log debug",
|
||||
{ARG_TYPE_STRING, 0, 0}
|
||||
},
|
||||
{
|
||||
@ -726,7 +747,9 @@ static void enable_log_action(DCB *dcb, char *arg1) {
|
||||
logfile_id_t type;
|
||||
int max_len = strlen("message");
|
||||
|
||||
if (strncmp(arg1, "trace", max_len) == 0) {
|
||||
if (strncmp(arg1, "debug", max_len) == 0) {
|
||||
type = LOGFILE_DEBUG;
|
||||
} else if (strncmp(arg1, "trace", max_len) == 0) {
|
||||
type = LOGFILE_TRACE;
|
||||
} else if (strncmp(arg1, "error", max_len) == 0) {
|
||||
type = LOGFILE_ERROR;
|
||||
@ -748,7 +771,9 @@ static void disable_log_action(DCB *dcb, char *arg1) {
|
||||
logfile_id_t type;
|
||||
int max_len = strlen("message");
|
||||
|
||||
if (strncmp(arg1, "trace", max_len) == 0) {
|
||||
if (strncmp(arg1, "debug", max_len) == 0) {
|
||||
type = LOGFILE_DEBUG;
|
||||
} else if (strncmp(arg1, "trace", max_len) == 0) {
|
||||
type = LOGFILE_TRACE;
|
||||
} else if (strncmp(arg1, "error", max_len) == 0) {
|
||||
type = LOGFILE_ERROR;
|
||||
|
Reference in New Issue
Block a user