# EssWriteToLogFile

Description

EssWriteToLogFile() writes a message to the Agent log file (`ESSBASE.LOG`), or to the Server log file (`APPNAME.LOG`).

Syntax

    ESS_FUNC_M  EssWriteToLogFile (hCtx, AgentLog, Message);

ESS_HCTX_T | hCtx
ESS_BOOL_T | AgentLog
ESS_STR_T | Message

Parameters

hCtx | Essbase API context handle.
AgentLog | If TRUE, message is written to the Agent log file, `ESSBASE.LOG`. If FALSE, message is written to the Server log file, `APPNAME.LOG`.
Message | Message to be logged to the Agent log file (`ESSBASE.LOG`), or to the Server log file (`APPNAME.LOG`).

Return Value

Returns a zero if successful.

Notes

- The Agent log file (`ESSBASE.LOG`) and the Server log file (`APPNAME.LOG`) are located on the server in the ARBORPATH directory. Use EssGetLogFile() to view message logs.

Access

The caller must have supervisor privilege (ESS_ACCESS_SUPER) for the specified application.

Example

    ESS_FUNC_M ESS_WriteToLogFile (ESS_HCTX_T hCtx)
    {
       ESS_STR_T     Message = NULL;
       ESS_FUNC_M     sts = ESS_STS_NOERR;

       Message = "Received login request";

       /*
        * Writes the message (Received login request) to the Agent log file.
        */
       sts = EssWriteToLogFile(hCtx, ESS_TRUE, Message);
       return(sts);
    }

See Also

EssDeleteLogFile()
EssGetLogFile()
EssLogSize()