pilg_checklogfile

This routine checks a local log file for size and copies it to a numbered backup file when it exceeds the maximum size.

The default size of 256KB may be changed in the pipc.ini file (the section is PIPC and the keyword is MAXLOGSIZE ranging from 4096 bytes to 4 MB.

The maximum number of log files by default is 20. This may be changed in the pipc.ini file (the section is PIPC and the keyword is MAXPIPCLOGS ranging from 1 to 10000).

The numbered log files cycle from pipc0000.log to the maximum number of files minus one and then restarts with pipc0000.log.

The action argument may be used to force a shift regardless of file size by setting action=1.

To check if the current file exceeds the maximum size set action=0.

To re-initialize the log file name, target file number for the next shift and re-read the MAXLOGSIZE and MAXPIPCLOGS values use action=-1. The logfile argument may be used to specify an alternate file to shift, otherwise a NULL indicates check the pipc.log file.

C format

PIINT32 pilg_checklogfile(

int action,

char PIPTR *logfile);

Returns

Success

Old file does not exist

13 

File already exists. Failed to remove old file

Arguments

action (passed)

Code for type of log file check.

logfile (passed)

Log file name.

Usage Notes

This routine is only available for Windows NT and Windows 9x.

At startup, the target log file for shifting is the pipc.log file, but this may be reset by passing an argument for the logfile. Otherwise, a null should be passed. Once initialized, the base log file name remains the same until another action=-1 is passed.

Enabling Operational Intelligence