(December 2016) This article mentions PI trusts, now superseded by more secure forms of authentication. AL00309 discusses the move from PI trusts to Windows Integrated Security (WIS) for PI API.
- Where is the PI Server message log file and how do you open it and read it?
- Where are the PI client log files?
- Where are the PI interface log files created and how do you read them?
- Where do the PI AF server and client log their messages?
- What PI System-related information is logged in the Windows Event Viewer logs?
The solutions described below are also on video on YouTube:
OSIsoft: How to View & Collect the PI Message Logs
OSIsoft: How to View & Collect Logs with Windows Event Viewer for PI Applications
PI message log files
To view the PI Server message log, you must use either PI System Management Tools (PI SMT) or the command line tool pigetmsg.exe.
(For details about the "pimsg.dat" log files, read Log file naming convention
in Live Library.)
OSIsoft: How to View & Collect the PI Message Logs using PI SMT at 06:41
To view the PI Server message log using PI SMT:
- From the Start menu choose All Programs > PI Server > PI System Management Tools.
- Check the check box next to the PI Server whose log files you want to see.
- Open the Operation > Message Logs.
- Click the magnifying glass icon (Retrieve Messages).
By default, the message log tool is set up to search for the last 5 minutes of messages (
-5m). You can change this to whatever time duration you want (for example, "t" is today starting from midnight, "y" is yesterday starting a midnight, "
-4d" is now until 4 days ago). You can also adjust other parameters you see (End time, Source, number of messages, Severity, and so on.)
To export the PI message log to a text file with PI SMT:
- Follow the steps above to view the PI message log with PI SMT.
- Click on the "Export to a file" icon and then choose "Export selected" or "Export all."
- By default, the name of the file will be PIMessageLog.txt. You can change the location where the file will be saved.
- Click Save.
- Open the resulting text file in any text editor.
OSIsoft: How to View & Collect the PI Message Logs using PI SMT at 02:10
Viewing the PI Server message log file using pigetmsg.exe
You might want to view the PI message log interactively so you can see messages as they are written in real-time. This can be helpful when troubleshooting or verifying connections to the PI Sever.
The pigetmsg.exe tool can view the PI Server message log as well as the PI client message log. When run on the PI Server, pigetmsg.exe returns the PI Server log. When run on a PI client, it returns the client message log. Pigetmsg.exe is located by default in PI\adm directory on the PI Server and in PIPC\adm on a PI client machine.
To view the tail of the PI Message log interactively:
- Run a command prompt window.
- Change to the pi\adm or pipc\adm directory (i.e. cd /d %piserver%\adm or cd /d %pihome%\adm).
- Type pigetmsg -f and press Enter.
To view a specific time period in the PI Message log:
- The following will output messages written in the last hour to the command prompt: pigetmsg -st "
*-1h" -et "
- The following will output messages written in the last hour to a text file in your PI\adm directory called logfile.txt: pigetmsg -st "
*-1h" -et "
*" > logfile.txt
The -st and -et flags respectively set the Start Time and End Time for pigetmsg to retrieve messages from the PI Message log. The start and end time format can be relative PI time as shown above or can be an absolute timestamp such as "01-Jan-2011 13:00:00" including the quotes, as in the following example:
pigetmsg -st "21-jun-2016 08:00:00" -et "21-jun-2016 11:00:00"
Viewing a remote PI Server message log using pigetmsg.exe
You can run pigetmsg.exe with the "- remote" parameter to view remote PI Server message logs if explicit login is enabled. However OSIsoft discourages the use of explicit logins for security purposes (See KB00304
for more information on how to eliminate the use of PI User passwords in PI Server).
Beginning with PI Server 3.4.380 (or PI SDK 2010 R2 for client/interface nodes), the pigetmsg utility supports PI Trust and Windows Integrated Security authentication. By adding -trust or -windows to the command, you can more securely connect to a PI Server with either of these authentication options:
pigetmsg -remote -trust
pigetmsg -remote -windows
When running pigetmsg -remote, it will prompt you for the node, username, and password . The node is the name or IP address of the PI Server and the username and password are credentials for a PI user. When running with the -trust or -windows parameters, it will only prompt you for the PI server node name. Note that pigetmsg -remote can only be used to remotely access PI server message logs.
PI client log files
Most PI clients
PI clients such as PI ProcessBook and PI DataLink write messages to the local PI message log. These messages are retrieved by the command line tool pigetmsg.exe, which is typically located in the PIPC\adm directory of the client machine. For instructions on how to use pigetmsg.exe, see "To view the PI Server message log file using pigetmsg.exe" above. Note that pigetmsg.exe can be used to view both PI server messages and PI client messages.
64-bit PI API-based clients
For 64-bit PI API applications on Windows, a separate pipc.log file is located in the %PROGRAMDATA%\PISystem\LogFiles directory (or %ALLUSERSPROFILE%\PISystem\LogFiles on operating systems before Windows Vista). A shortcut to the directory called PIPC.LOG Location is located in the %PIHOME64%\Dat directory.
PI Interface logs
UniInt 4.5+ Interfaces (most common)
Most interfaces based on UniInt 4.5 and above write to the local PI message log. You can save messages from the local PI message log to a text file using pigetmsg.exe or the PIMessages.bat script. See KB00401
for more information.
Certain interfaces have their own log message mechanisms, most notably PI UFL, PI RDBMS, and PI APS. For more details, refer to the interface-specific documentation.
Many older interfaces (UniInt 4.4 and below) write messages to the pipc.log file.
The pipc.log can be found in the following places:
- On Windows, the pipc.log is typically in the PIPC\Dat directory.
- On UNIX, the message log is $PIHOME/dat/pimesslogfile.
- On VMS, the message log is PIsysmgr:pimesslog.txt.
To view the PI Interface log files (PIPC.LOG) on Windows On Windows, you can view the pipc.log files using Notepad, PI System Management Tools, or the PI Interface Configuration Utility (ICU).
- Open the pipc.log by choosing File> Open and navigating to the PIPC\Dat folder to locate it.
- You can also right-click on the pipc.log file and choose Open with and select an editor.
For the 64-bit PI API pipc.log files, click on the PIPC.LOG Location shortcut installed to %PIHOME64%\Dat\ to navigate to the correct directory of the pipc.log file.
Prerequisite: PI System Management Tools must be installed on the same machine as the log file.
- From the Start menu choose All Programs> PI Server> PI System Management Tools.
- Check the PI Server whose log files you want to see.
- Open the Operation > PI Message log tree.
- Click on Local PIPC.logs.
: PI SMT finds the pipc.log file located in the PIPC\Dat directory. Therefore, it cannot currently view the pipc.log files generated by the 64-bit Windows PI API.
Using the PI Interface Configuration Utility
- From the PI ICU Start menu chose All Programs> PI System> PI-Interface Configuration Utility.
- On the Tools pull-down menu, click Log Files.
- In the Log Files dialog box, double-click on the pipc.log entry. The pipc.log file appears.
: PI ICU finds the pipc.log file located in the PIPC\Dat directory. Therefore it cannot currently view the pipc.log files generated by the 64-bit Windows PI API.
On UNIX and Linux
Messages logged by the PI API and interfaces running on UNIX and Linux machines are written to the $PIHOME/dat/pimesslogfile. This is a text-based file. The UNIX "tail" command can be used to view the last few lines of the log file, or it can be viewed with any text editor.
For 64-bit interfaces on Windows, a separate pipc.log file is located in the %PROGRAMDATA%\PISystem\LogFiles directory (or %ALLUSERSPROFILE%\PISystem\LogFiles on operating systems before Windows Vista). A shortcut to the directory called PIPC.LOG Location is located in the %PIHOME64%\Dat\ directory.
PI AF Server, Analysis, Notifications, and client logs
PI AF Server
The PI AF Server logs messages to the AF Windows event log on the PI AF server machine.
- On the PI AF server machine, go to Start and run eventvwr.
- In Event Viewer, expand Applications and Services Logs and select the AF event log to view PI AF-related messages.
PI Analysis Service
The PI Analysis Service message logs are located in the %ProgramData%\OSIsoft\PIAnalysisNotifications\Logs directory. The archived message logs are located in the "archives" folder found in the same directory.
- The pianalysismanager-log holds message logs relating to system performance.
- The pianalysisprocessor-log holds the message logs related to current analysis calculations.
- The pirecalculationprocessor-log holds the message logs related to backfilling and recalculations.
The Notifications message logs are located in the %ProgramData%\OSIsoft\PINotifications\Logs directory. The archived message logs are located in the "archives" folder found in the same directory.
PI AF Client
PI AF clients such as PI System Explorer logs messages to the local PI Message log. For more information on how to retrieve this log, see the section "PI Client log files" above.
PI OLEDB Provider
The PI OLEDB Provider uses specific initialization properties that define where it logs messages. Please refer to its manual
for more information.
Windows event logs
OSIsoft: How to View & Collect Logs from Windows Event Viewer for PI Applications
When troubleshooting PI issues, the Windows event logs may contain additional useful information related to the operation of the PI system. For example, PI WebParts
, PI Web Services
, and PI Coresight
can all write messages to the Windows event logs. Furthermore, the Windows event logs may reveal issues with underlying technologies that the PI system depends on to function properly.
Application event log
If the PI Message Subsystem is not running, all messages go to the Windows application event Log. When the PI Message Subsystem starts, it merges messages from the Windows event log into the PI Server message log. Note
: During startup, some components might write messages to the Windows event log before the PI Message Subsystem starts. If a PI server subsystem or client application terminates unexpectedly, an error message will get logged to the Windows application event log. This is useful to pinpoint the time of the crash in order to investigate relevant messages in the PI message logs leading up to the time of the crash.
System event log
Any time a Windows service is started or stopped, that event is logged in the system event log. This can be useful to determine when a PI service was started or stopped and can help determine if a PI service was stopped intentionally by a user, or if the underlying process terminated unexpectedly.
Security event log
The Security event log may include additional information that can help troubleshoot PI server Windows Integrated Security, PI AF security, and OPC DCOM security. For more information about what gets logged to the Security event log, see the documentation that was installed with the corresponding PI software.
- Most interfaces write a performance summary every 8 hours to the pipc.log file. The API Buffer Server (BufServ.exe) also writes to the pipc.log file, however the PI Buffer Subsystem writes to the PI message log as well.
- The PI message log files shift every night at midnight. Log files are maintained for 35 days before the PI System deletes them.
- The PI Backup copies log files, so log files older than 30 days can be accessed from your backups (see the System Manager's Resource Backups page for more details on backups.)
- On UNIX and Linux, the pimesslogfile is shifted every night at midnight and the old log file renamed with the date as the file extension. There is no automatic deleting of the old log files. Therefore, it is recommended that a cron task be configured to remove files older than a specific period. For details, refer to the PIAPI manual, "UNIX Installation Procedures" - "Purging Log Files".
- Configuring PIPC.LOG file preferences: The size and number of pipc.log files are configured in the pipc.ini file by using the following section and keyname entries.