added timestamp to shutdown messages in ndbd

parent 3c6ec2a9
...@@ -57,7 +57,7 @@ int main(int argc, char** argv) ...@@ -57,7 +57,7 @@ int main(int argc, char** argv)
NDB_INIT(argv[0]); NDB_INIT(argv[0]);
// Print to stdout/console // Print to stdout/console
g_eventLogger.createConsoleHandler(); g_eventLogger.createConsoleHandler();
g_eventLogger.setCategory("NDB"); g_eventLogger.setCategory("ndbd");
g_eventLogger.enable(Logger::LL_ON, Logger::LL_CRITICAL); g_eventLogger.enable(Logger::LL_ON, Logger::LL_CRITICAL);
g_eventLogger.enable(Logger::LL_ON, Logger::LL_ERROR); g_eventLogger.enable(Logger::LL_ON, Logger::LL_ERROR);
g_eventLogger.enable(Logger::LL_ON, Logger::LL_WARNING); g_eventLogger.enable(Logger::LL_ON, Logger::LL_WARNING);
......
...@@ -30,13 +30,15 @@ ...@@ -30,13 +30,15 @@
#include <NodeState.hpp> #include <NodeState.hpp>
#include <NdbMem.h> #include <NdbMem.h>
#include <NdbOut.hpp>
#include <NdbMutex.h> #include <NdbMutex.h>
#include <NdbSleep.h> #include <NdbSleep.h>
#include <EventLogger.hpp>
extern "C" { extern "C" {
extern void (* ndb_new_handler)(); extern void (* ndb_new_handler)();
} }
extern EventLogger g_eventLogger;
/** /**
* Declare the global variables * Declare the global variables
...@@ -141,23 +143,23 @@ NdbShutdown(NdbShutdownType type, ...@@ -141,23 +143,23 @@ NdbShutdown(NdbShutdownType type,
switch(type){ switch(type){
case NST_Normal: case NST_Normal:
ndbout << "Shutdown initiated" << endl; g_eventLogger.info("Shutdown initiated");
break; break;
case NST_Watchdog: case NST_Watchdog:
ndbout << "Watchdog " << shutting << " system" << endl; g_eventLogger.info("Watchdog %s system", shutting);
break; break;
case NST_ErrorHandler: case NST_ErrorHandler:
ndbout << "Error handler " << shutting << " system" << endl; g_eventLogger.info("Error handler %s system", shutting);
break; break;
case NST_ErrorHandlerSignal: case NST_ErrorHandlerSignal:
ndbout << "Error handler signal " << shutting << " system" << endl; g_eventLogger.info("Error handler signal %s system", shutting);
break; break;
case NST_Restart: case NST_Restart:
ndbout << "Restarting system" << endl; g_eventLogger.info("Restarting system");
break; break;
default: default:
ndbout << "Error handler " << shutting << " system" g_eventLogger.info("Error handler %s system (unknown type: %u)",
<< " (unknown type: " << (unsigned)type << ")" << endl; shutting, (unsigned)type);
type = NST_ErrorHandler; type = NST_ErrorHandler;
break; break;
} }
...@@ -173,7 +175,7 @@ NdbShutdown(NdbShutdownType type, ...@@ -173,7 +175,7 @@ NdbShutdown(NdbShutdownType type,
/** /**
* Very serious, don't attempt to free, just die!! * Very serious, don't attempt to free, just die!!
*/ */
ndbout << "Watchdog shutdown completed - " << exitAbort << endl; g_eventLogger.info("Watchdog shutdown completed - %s", exitAbort);
#if defined VM_TRACE && ( ! ( defined NDB_OSE || defined NDB_SOFTOSE) ) #if defined VM_TRACE && ( ! ( defined NDB_OSE || defined NDB_SOFTOSE) )
signal(6, SIG_DFL); signal(6, SIG_DFL);
abort(); abort();
...@@ -227,7 +229,7 @@ NdbShutdown(NdbShutdownType type, ...@@ -227,7 +229,7 @@ NdbShutdown(NdbShutdownType type,
} }
if(type != NST_Normal && type != NST_Restart){ if(type != NST_Normal && type != NST_Restart){
ndbout << "Error handler shutdown completed - " << exitAbort << endl; g_eventLogger.info("Error handler shutdown completed - %s", exitAbort);
#if ( defined VM_TRACE || defined ERROR_INSERT ) && ( ! ( defined NDB_OSE || defined NDB_SOFTOSE) ) #if ( defined VM_TRACE || defined ERROR_INSERT ) && ( ! ( defined NDB_OSE || defined NDB_SOFTOSE) )
signal(6, SIG_DFL); signal(6, SIG_DFL);
abort(); abort();
...@@ -243,7 +245,7 @@ NdbShutdown(NdbShutdownType type, ...@@ -243,7 +245,7 @@ NdbShutdown(NdbShutdownType type,
exit(restartType); exit(restartType);
} }
ndbout << "Shutdown completed - exiting" << endl; g_eventLogger.info("Shutdown completed - exiting");
} else { } else {
/** /**
* Shutdown is already in progress * Shutdown is already in progress
...@@ -253,7 +255,7 @@ NdbShutdown(NdbShutdownType type, ...@@ -253,7 +255,7 @@ NdbShutdown(NdbShutdownType type,
* If this is the watchdog, kill system the hard way * If this is the watchdog, kill system the hard way
*/ */
if (type== NST_Watchdog){ if (type== NST_Watchdog){
ndbout << "Watchdog is killing system the hard way" << endl; g_eventLogger.info("Watchdog is killing system the hard way");
#if defined VM_TRACE && ( ! ( defined NDB_OSE || defined NDB_SOFTOSE) ) #if defined VM_TRACE && ( ! ( defined NDB_OSE || defined NDB_SOFTOSE) )
signal(6, SIG_DFL); signal(6, SIG_DFL);
abort(); abort();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment