Skip to main content

Log

This class is used to retrieve a log or a Trace.

Table 1. Log agent type table

Symbolic

Code

FCREPL_LOGAGENT_INVALID

-1

FCREPL_LOGAGENT_INTERNAL

0

FCREPL_LOGAGENT_DBENGINE

1

FCREPL_LOGAGENT_REPLSTUDIO

2

FCREPL_LOGAGENT_REPLAGENT

3

FCREPL_LOGAGENT_WEBSERVER

4



Table 2. Log type table

Symbolic

Table

FCREPL_LOGTYPE_INVALID

-1

FCREPL_LOGTYPE_INFO

0

FCREPL_LOGTYPE_WARNING

1

FCREPL_LOGTYPE_ERROR

2

FCREPL_LOGTYPE_EXCEPTION

3

FCREPL_LOGTYPE_TRACE

4



Table 3. Log/trace severity level

Symbolic

Code

Description

FCREPL_CRITICAL

0

Most critical

FCREPL_SEV1

1

Critical

FCREPL_SEV2

2

Important

FCREPL_SEV3

3

Normal

FCREPL_INFO

4

Long information

FCREPL_TRACE_LEVEL

5

Trace information



Table 4. Log/trace detail level

Symbolic

Code

Description

FCREPL_DETAIL_ERROR

1

Only errors

FCREPL_DETAIL_INFO

2

Above + basic information

FCREPL_DETAIL_TRACE1

3

Above + trace basic level

FCREPL_DETAIL_TRACE2

4

Above + trace detail level



Class

FCREPLLog

Log/trace/exception entity class.

Getters

Table 5. Getters

Log type

FCREPLLogType GetType() { return (FCREPLLogType)((pRCESLog)this)->GetType(); };

Log agent type

FCREPLLogAgent GetAgent() { return (FCREPLLogAgent)((pRCESLog)this)->GetAgent(); };

Log detail level

FCREPLDetailLevel GetDetailLevel() { return (FCREPLDetailLevel)((pRCESLog)this)->GetDetailLevel(); };

Log security level

FCREPLSeverity GetSevLevel() { return (FCREPLSeverity)((pRCESLog)this)->GetSevLevel(); };



Inherited getters

Table 6. Inherited getters

Log event time

RCESDateTime GetTime();

Log event type

RCESLogType GetType();

DBEngine identification

Note

This is linked to FCREPLDBEngine class.

int GetDBEngineID();

Log agent

RCESLogAgent GetAgent();

Log agent name

const char *GetAgentName();

Log function name

const char *GetFunctionName();

Log detail level

RCESDetailLevel GetDetailLevel();

Log severity level

RCESSeverity GetSevLevel();

Log error code

int GetErrorCode();

Log error message

const char *GetErrorMessage();



Setters

Table 7. Setters

Log type

void SetType(FCREPLLogType type) { ((pRCESLog)this)->SetType((RCESLogType)type); };

Log agent type

void SetAgent(FCREPLLogAgent agent) { ((pRCESLog)this)->SetAgent((RCESLogAgent)agent); };

Log detail level

void SetDetailLevel(FCREPLDetailLevel detailLevel) { ((pRCESLog)this)->SetDetailLevel((RCESDetailLevel)detailLevel); };

Log severity level

void SetSevLevel(FCREPLSeverity sevLevel) { ((pRCESLog)this)->SetSevLevel((RCESSeverity)sevLevel); };

Log agent name

void SetAgentName(const char *agentName) { ((pRCESLog)this)->SetAgentName(agentName); };

Log function name

void SetFunctionName(const char *functionName) { ((pRCESLog)this)->SetFunctionName(functionName); };

Log error message

void SetMessage(const char *message) { ((pRCESLog)this)->SetMessage(message); };



Inherited setters

Table 8. Inherited setters

Log event time

void SetTime(RCESDateTime time);

Log type

void SetType(RCESLogType type);

Log agent

void SetAgent(RCESLogAgent agent);

DBEngine identification

Note

This is linked to the FCREPLDBEngine class.

void SetDBEngineID(int dbEngineID);

Log agent name

void SetAgentName(const char *agentName);

Log function name

void SetFunctionName(const char *functionName);

Log detail level

void SetDetailLevel(RCESDetailLevel detailLevel);

Log severity level

void SetSevLevel(RCESSeverity sevLevel);

Log error code

void SetErrorCode(int errorCode);

Log message

void SetMessage(const char *message);



Retrieve the latest Log entity objects.

Prototype

FCREPL_API int fcReplGetLatestLogs(pFCREPLConn replConn, int latestCount, FCREPLDetailLevel maxDetailLevel, FCREPLSeverity maxSevLevel, bool showDBEngine, bool showReplStudio, bool showReplAgent, bool showWebServer, int dbEngineID, const char *funcName, int errorCode, ppFCREPLLog *logList, int *logCount);

Parameters

Table 9. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

latestCount [IN]

Number of latest log entries to be retrieved

maxDetailLevel [IN]

Maximum detail level to be retrieved

maxSevLevel [IN]

Maximum severity level to be retrieved

showDBEngine [IN]

Show DBEngine messages

showReplStudio [IN]

Show Replication Studio messages

showReplAgent [IN]

Show Replication Agent messages

showWebServer [IN]

Show web server messages

dbEngineID [IN]

DBEngine identification to have the logs filtered by

funcName [IN]

Partial function name to have the logs filtered by

errorCode [IN]

Error code to have the logs filtered by

logList [OUT]

Log list in JSON format

logCount [OUT]

Number of items in the logList



Return

Error code

Retrieve the log entity objects.

Prototype

FCREPL_API int fcReplGetLogs(pFCREPLConn replConn, FCREPLDateTime startTime, FCREPLDateTime endTime, FCREPLDetailLevel maxDetailLevel, FCREPLSeverity maxSevLevel, bool showDBEngine, bool showReplStudio, bool showReplAgent, bool showWebServer, int dbEngineID, const char *funcName, int errorCode, int logListSize, int logStart, ppFCREPLLog *logList, int *logCount, int *totalLogs);

Parameters

Table 10. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

startTime [IN]

Period start time

endTime [IN]

Period end time

maxDetailLevel [IN]

Maximum detail level to be retrieved

maxSevLevel [IN]

Maximum severity level to be retrieved

showDBEngine [IN]

Show DBEngine messages

showReplStudio [IN]

Show Replication Manager messages

showReplAgent [IN]

Show Replication Agent messages

showWebServer [IN]

Show web server messages

dbEngineID [IN]

DBEngine identification to have the logs filtered by

funcName [IN]

Partial function name to have the logs filtered by

errorCode [IN]

Error code to have the logs filtered by

logListSize [IN]

Log list count to be retrieved

logStart [IN]

Log list start record

logList [OUT]

Log entity list

logCount [OUT]

Number of log entities in the list

totalLogs [OUT]

Total number of log entities



Return

Error code

Archive the log events that happened before a given number of days.

Prototype

FCREPL_API int fcArchiveLog(pFCREPLConn replConn, int daysToArchive);

Parameters

Table 11. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

daysToArchive [IN]

Number of days to keep active



Return

Error code