mirror of
https://github.com/MariaDB/server.git
synced 2026-04-30 20:25:32 +02:00
BUG#11331 "Warning: could not add log destination" message does not provide enough info
Implement error reporting to Logger and associated classes. ndb/include/logger/LogHandler.hpp: Add error string to LogHandler along with error code ndb/include/logger/Logger.hpp: Add reporting back of error to addHandler(BaseString). ndb/src/common/logger/FileLogHandler.cpp: Implement error reporting ndb/src/common/logger/LogHandler.cpp: Implement error reporting. Trim spaces and tabs out of parameter names. This allows "p=v, param=value" ndb/src/common/logger/Logger.cpp: Report back errors when adding a handler via BaseString ndb/src/common/logger/SysLogHandler.cpp: Report an error on invalid syslog facility ndb/src/mgmsrv/MgmtSrvr.cpp: Report error when adding log handler
This commit is contained in:
parent
31ff9e9a10
commit
ba3086a2d2
7 changed files with 79 additions and 11 deletions
|
|
@ -125,6 +125,18 @@ public:
|
|||
*/
|
||||
void setErrorCode(int code);
|
||||
|
||||
/**
|
||||
* Returns the error string.
|
||||
*/
|
||||
char* getErrorStr();
|
||||
|
||||
/**
|
||||
* Sets the error string.
|
||||
*
|
||||
* @param str the error string.
|
||||
*/
|
||||
void setErrorStr(char* str);
|
||||
|
||||
/**
|
||||
* Parse logstring parameters
|
||||
*
|
||||
|
|
@ -195,6 +207,7 @@ private:
|
|||
|
||||
const char* m_pDateTimeFormat;
|
||||
int m_errorCode;
|
||||
char* m_errorStr;
|
||||
|
||||
// for handling repeated messages
|
||||
unsigned m_count_repeated_messages;
|
||||
|
|
|
|||
|
|
@ -178,8 +178,11 @@ public:
|
|||
* Add a new handler
|
||||
*
|
||||
* @param logstring string describing the handler to add
|
||||
* @param err OS errno in event of error
|
||||
* @param len max length of errStr buffer
|
||||
* @param errStr logger error string in event of error
|
||||
*/
|
||||
bool addHandler(const BaseString &logstring);
|
||||
bool addHandler(const BaseString &logstring, int *err, int len, char* errStr);
|
||||
|
||||
/**
|
||||
* Remove a log handler.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue