I'm going to show you how to collect the PI
Message Logs. These are also often referred
to as the PI SDK Logs. PI Interfaces,
the PI Buffer Subsystem and the PI Data Archive all write to these logs.
So if your issue involves one of these components,
you'll likely have to collect the PI Message Logs.
This includes scenarios where you can't connect to the PI Data
Archive for example using a PI visualization tool.
If your issue involves a different component
such as the PI AF Server, you might need to collect
the Windows Event Logs instead. I'll show you how to do that in the next
video. Before you start, you'll need the
following. First you need to figure out which computer to
gather the logs from. This needs to be the
computer where the application is installed. For example to gather the
messages posted by a PI Interface,
you'll need to log onto the computer where the PI Interface is
installed. Next you need to decide the
time-range for which you'll be collecting the logs. Make
sure that the time at which your issue occurred
is included in the range you are collecting. For example collect one
day before and after the time of your issue. Let's do an
example. Say you have a PI Interface
that stops sending data at 1PM on July 26th.
Which computers will you collect the logs from?
Of course you'll collect the logs from the computer
where the PI Interface is installed. But the PI
Data Archive logs might also collect information about your issue.
So you'll want to collect the logs from that Server as well.
Next we need to make sure to collect the logs from the right
time-range. Let's write out the start time and end
time so we don't make any mistakes. I'm going to collect the logs
from July 25th at 1PM
- July 27th at 1PM. It's common to make
formatting mistakes while writing the time. So I would
suggest using the follow format since it will
always give you the expected result. Use the three
letter abbreviation for the month and write the time in the
24 hour clock also known as military time.
Here is my start time and end time in this format.
Alright let's get started.
First I'll logon to the computer where the
PI Interface is installed. I'll show you two methods
of gathering these logs. First using
a command line utility called PI Get Message
and then using the PI SDK Utility.
The PI Get Message command line utility is a great
option especially when you want to send these logs to someone
else like a tech support engineer. It's available
on all computers with a PI message log
and can output the logs in multiple different file formats.
The first step is to run the command prompt.
So let's go to our start menu
and type CMD and make sure to right
click and select run as administrator.
First we'll want to navigate
to the right directory and type the following
cd /d
PIHome%Adm.
This is the correct
command for any computer that's not your PI Data Archive.
If you are logged onto the PI Data Archive,
make sure to write %PIServer% instead.
Next we'll
use the utility to create a file that contains our messages.
Type pigetmsg
-st
And now we'll want to put our start time parameter.
You'll want to put your start time in quotes.
So start with quotes and then write the time in the
format that we discussed previously.
Next you'll want to add your end time parameter,
so -et. Once again make sure
to put your timestamp in quotes.
Finally we want to specify our
output file. So type -of
and put the name of your file in quotes.
You'll want to give your file a meaningful
name. At the end, put your file extension
and you'll normally want to use the file extension
.txt and then close the file name
with quotes. A tech support engineer might ask
you for the logs in the raw PI message log format.
In that case type .dat instead
as the file extension. After reviewing
your command, go ahead and click
enter.
If there no messages contained in the log between your start time and your end
time, you'll get an output that says no messages.
So watch out for that. The final step
is to open our file and make sure we've collected the right
logs. To open the file location, simply
type start .
Here is our file so let's open it
and we can quickly
confirm that we have collected the logs
from the computer where the PI Interface is installed
and that we have the correct start time
and end time at
the bottom. We can now copy this log onto a new
computer and if we want, send it to tech support.
Now I'll show you how to use the
PI SDK Utility to view and export the message logs.
This option is great, especially
if you want to read and filter the logs locally
while troubleshooting your issue on the machine. Note however
that you can only export the logs in the CSV or TXT
file formats and that the files output from this
utility are not as easy to read.
Let's go to our start menu
and type PI SDK. You might find two applications
32 bit and 62 bit ones. It doesn't
matter which one you
choose. Under tools, select message log.
You'll want to add your start time and
end time here. If your end time is
now you can leave the star in this field.
If you are exporting these logs for
tech support, make sure not to put any filters here
as they'll most likely want the raw logs.
However you will want to change the severity
here. By default in the PI SDK Utility
the severity is set to error. You'll
want to make sure to change this to debug in order to
gather all of the logs.
You can now look through the logs and if you are troubleshooting on your
own, you can use the filters. If you want to export the
logs, go ahead and click this button here.
Once again make sure to give your
file a meaningful name.
One last thing I want to show you is how to
collect the PI message logs on the PI Data Archive
without having to logon to the PI Data Archive Server. To
do this, you need PI System Management Tools installed
on your computer. So let's open up that utility.
Make sure that you
are connected to the right PI Data Archive in
the Servers pane at the top left.
Navigate to operation and then message
logs.
Add your start time and your end time and
these fields here.
To search, click on
the magnifying glass here.
To export the logs,
click on this button.
Make sure to select
export all.
Once again give your log a meaningful name.
You'll want to make sure to indicate that these
are the PI Data Archive logs.
Once you've collected all the logs, you are ready to continue
to troubleshooting and if necessary get help from tech support.