Log File Utility

On a Windows operating system, the pilogsrv service is installed and set to run automatically on system startup. This utility serves two purposes. It first limits the size of log files on disk, and secondly migrates new messages into the PINS log in order to keep all PI messages in one repository.

Note: For the 64-bit PI API, the pipc.log files are stored in %ProgramData%\PISystem\LogFiles (or %ALLUSERSPROFILE%\Application Data\PISystem\LogFiles on operating systems before Windows Vista). The 32-bit PI API pipc.log files are stored in %PIHOME%\DAT.

Log File Rollover

The pilogsrv process monitors the size of the pipc.log file and creates backup files when it exceeds a predefined size. The commands pilogsrv -start and pilogsrv -stop or the Control Panel> Services utility may also be used to start and stop pilogsrv. The service may be configured to rename the log file at a user defined size between 1 kb and 4 MB (by default, 256 kb) and keep up to 9999 log files (by default, 20).

The pilogsrv service renames pipc.log to pipcxxxx.log where ‘xxxx' ranges from ‘0000' up to the maximum specified number of files. When the maximum number is reached, numbering restarts at ‘0000’.

Log file size limits for the rollover functionality may be controlled by these settings in the pipc.ini configuration file.

[PIPC]

MAXPIPCLOGS=20

MAXLOGSIZE=262144

CHECKLOGINTERVAL=600

Log File Migration

The service may also be configured to copy, or migrate, messages written to pipc.log into the local PI-SDK log (PINS log). A configuration flag, MIGRATELOG, must be set before starting the service for this to occur.

These settings are configured in the pipc.ini file by using the following section and keyname entries.

[PIPC]

MIGRATELOG=1

If log message migration is configured, messages copied into the PI-SDK log will have a message source of pilogsrv.exe.

Enabling Operational Intelligence