tplogsetreqfile — Set request logging file
#include <atmi.h>
int tplogsetreqfile(char **data, char *filename, char *filesvc);
For XATMI client link with -latmiclt -latmi -lubf -lnstd -lpthread -lrt -lm
For XATMI server link with -latmisrv|-latmisrvnomain|-latmisrvinteg -latmi -lubf -lnstd -lpthread -lrt -lm
Function enables request logging with advanced configuration. With this function you may do following:
All function parameters are conditional. If every field will be NULL or EOS, then function will return error. The order of the parameter usage is following:
Function applies to all Enduro/X logging facilities: TP, NDRX and UBF.
Special care shall be taken when working in multi-threaded environment (this includes single thread apps running built in Enduro/X emq, poll and SystemV modes where auxiliary threads are used. In mulit-threaded mode, the output file name shall differ for process logging file name. Otherwise the output file pointer is re-used from process logger. Thus If other thread changes process loggers, this process request logger file pointer might become broken (and thus cause segmentation faults). See more on thread safety section in tplogconfig(3).
On success, tplogsetreqfile() return zero; on error, -1 is returned, with tperrno set to indicate the error.
Note that tpstrerror() returns generic error message plus custom message with debug info from last function call.
TPEINVAL Missing file name in parameters (invalid parameter combination).
TPENOENT No service (filesvc parameter) advertised in system.
TPETIME Service did not reply in given time (NDRX_TOUT).
TPESVCFAIL Service returned TPFAIL. This is application level failure.
TPESVCERR System level service failure. Server died during the message presence in service queue.
TPESYSTEM System failure occurred during serving. See logs i.e. user log, or debugs for more info.
TPEOS System failure occurred during serving. See logs i.e. user log, or debugs for more info.