Difference between revisions of "Doc:latest/logtoolguide"

(Preface)
(Available Log Tools)
Line 1: Line 1:
 
http://www.buyxanaxonlinepill.com/ buy xanax online - xanax
 
http://www.buyxanaxonlinepill.com/ buy xanax online - xanax
  
=='''Available Log Tools'''==
+
http://www.buyxanaxonlinepill.com/ buy xanax online - online xanax
 
+
Log files come in 2 flavors, binary and ASCII. ASCII files are easily viewable using standard Linux editors and tools (vi, emacs, tail, etc).  By default OpenClovis writes all of its logs in ASCII format.  However you may want to change this to binary format or create your own binary format logs.  For the binary format logs OpenClovis provides access using following tools :
+
* [[#Using Command Line Log Tool | Command Line Log Tool ]]
+
* [[#Using Offline GUI Log Tool | Offline GUI Log Tool ]]
+
 
+
 
+
===Using Command Line Log Tool===
+
 
+
The online log viewer is a command line utility which may be used to view the Log Records present in the binary log files. The online log viewer only works on binary log files. To view an ASCII log file simply open them with your favorite editor.
+
 
+
The online log viewer displays the log records after some required conversion. It converts the Severity, StreamId, ComponentId to their corresponding names. This conversion is done using information present in metadata file (cfg file) corresponding to each log file. By default, the online log viewer displays the following fields of a log record:
+
# SeverityName
+
# StreamName
+
# ComponentName
+
# ServiceId
+
# MessageId
+
# TimeStamp
+
# Message
+
 
+
[[File:OpenClovis_Note.png]]Its very rare that log viewer does not find the stream id to stream name mapping in cfg file. If it does not then it would display the stream id in place of stream name. Same holds true for component id to component name mapping. In this situation it would not be possible to apply filter on that field.
+
 
+
Online log viewer executable <code>'''asp_binlogviewer'''</code> is deployed in <code>'''bin'''</code> directory of the SAFplus Platform. This online log viewer may be used in following ways :
+
<ol>
+
 
+
<li> To view log records present in a log file (or a set of log files when multiple log files are present for a logical log file) in real time i.e. when logging is going on. In this case it seeks to the latest record and starts displaying the record from that point (which can even be the last record of the log file). As the Log Server writes, this Log Tool tails the files and prints it to the Console. It automatically detects file rollover and tails the new file.
+
<br>'''Usage''':
+
<code><pre>
+
asp_binlogviewer -l <log_file_prefix>
+
                [-f <filter>]
+
                [-t <msg_id_map_file>]
+
                [-p <num_prev_recs>]
+
                [-c <column(s)>]
+
                [-a] [-h|--help]
+
</pre></code>
+
 
+
<li>To convert a binary log file to its corresponding text file (this text file contains the log records in exactly the same format as it is displayed on the console) :
+
<br>'''Usage''':
+
<code><pre>
+
asp_binlogviewer -L <log_file_path>
+
                [-C <cfg_file_path>]
+
                [-t <msg_id_map_file>]
+
                [-h|--help]
+
</pre></code>
+
[[File:OpenClovis_Note.png]]User may convert a binary log file to its corresponding text file when logging is going on as well as when it has stopped.
+
 
+
</ol>
+
 
+
 
+
====Viewing log records in real time====
+
 
+
=====Specify the location of log files=====
+
 
+
*<code>-l</code>: This is the mandatory option for viewing records in real time.
+
 
+
It is used to specify the common prefix to log files (symbolic links to log files) on file system. <code><log_file_prefix></code> is common prefix of log file names.
+
 
+
'''Example''':
+
<br>The log files are <code>/tmp/logFile.0</code> <code>/tmp/logFile.1</code> and <code>/tmp/logFile.2</code>.
+
 
+
'''Usage''':
+
<code><pre>
+
$ASP_BINDIR/asp_binlogviewer -l /tmp/logFile
+
</pre></code>
+
 
+
=====Setting Filter on a header field=====
+
 
+
*-f : User may specify filter on one of the header fields
+
 
+
<code><filter></code> should be specified as:
+
 
+
"<header field><comparision operator><value>"
+
 
+
'''\<header field\> options:'''
+
 
+
* s - SeverityName
+
* r - StreamName
+
* c - ComponentName
+
* v - ServiceId
+
* t - TimeStamp
+
* m - MessageId
+
 
+
'''\<comparision operator\> options:'''
+
 
+
* <code>=</code> Equal To
+
* <code>!=</code> Not Equal To
+
* <code><</code> Less Than
+
* <code><=</code> Less Than and Equal To
+
* <code>></code> Greater Than
+
* <code>>=</code> Greater Than and Equal To
+
 
+
'''Possible \<value\> in a filter:'''
+
 
+
'value' should be:
+
 
+
*String for following fields : SeverityName, StreamName, ComponentName
+
*HH:MM:SS for TimeStamp
+
*Integer for following fields : ServiceId, MessageId
+
+
'''Example''':
+
<br>Set filter on stream name (StreamName) 'CL_LOG_APPLICATION'
+
 
+
'''Usage''':
+
$ASP_BINDIR/asp_binlogviewer -l <log_file_prefix>  -f "r=CL_LOG_APPLICATION"
+
 
+
For time stamp having value greater than 4.30pm...
+
 
+
'''Usage''':
+
$ASP_BINDIR/asp_binlogviewer -l <log_file_prefix>  -f "t>16:30:00"
+
 
+
=====Specify TLV mapping file=====
+
 
+
*-t : This option is used when log files contain records of TLV (tag length value) format.
+
 
+
Specify complete path to TLV mapping file.
+
 
+
'''Example''':
+
<br><code>tlvmap.txt</code> contains the TLV mapping for log records of log file /tmp/sys.0
+
 
+
'''Usage''':
+
$ASP_BINDIR/asp_binlogviewer -l /tmp/sys -t tlvmap.txt
+
 
+
Following is a sample TLV map file which contains message id to TLV message mapping. TLV File content should be in following format :
+
<code><pre>
+
Message_ID<space>Message containing %TLV
+
</pre></code>
+
where <code><space></code> is a single space.
+
 
+
[[File:OpenClovis_Note.png]]All the %TLV are replaced by their corresponding values from log record's tag, length, value information for that message id.
+
 
+
Following are the sample content of a TLV map file tlvmap.txt :
+
<code><pre>
+
5 Component %TLV was unble to start on node %TLV
+
6 State Change: Entity [%TLV] Operational State (%TLV -> %TLV) AMF (%TLV)
+
7 Registering Component %TLV via eoPort %TLV
+
8 Extending %TLV byte pool of %TLV chunkSize
+
</pre></code>
+
 
+
This file contains the message id to string mapping for TLV (tag lengh value) messages. '%TLV' of tlv strings are replaced by the corresponding value found in the log record.
+
 
+
=====Display previous log records=====
+
 
+
* -p: Display <code><num_prev_recs></code> previous log records and exit
+
 
+
<code><num_prev_recs></code> is the number of previous log records to be displayed. If user specifies a number greater than the maximum log records or number of log records actually present in all the log files then entire log is displayed.
+
 
+
'''Example''':
+
<br>View 10 previous records
+
 
+
'''Usage''':
+
$ASP_BINDIR/asp_binlogviewer -l <log_file_prefix> -p 10
+
 
+
=====Display only selected fields of Log Record=====
+
 
+
*-c : Display selected field(s) of Log Record
+
 
+
User may choose to display only selected fields of log record. This can be achieved by using -c option where the numbers are separated by ',' .
+
 
+
The default columns are :
+
# SeverityName
+
# StreamName
+
# ComponentName
+
# ServiceId
+
# MessageId
+
# TimeStamp
+
# Message
+
 
+
'''Example''':
+
<br>Display only the following fields: StreamName, ServiceId, TimeStamp 
+
 
+
'''Usage''':
+
$ASP_BINDIR/asp_binlogviewer -l <log_file_prefix> -c 2,4,6
+
 
+
=====Display records present in entire log file(s)=====
+
*-a : Display entire log and exit
+
 
+
This option displays all the log records present in a log file or all log files when multiple log files are present for single logical file.
+
 
+
'''Example''':
+
<br>Display all the log records which file <code>/tmp/sys.0</code> contains
+
 
+
'''Usage''':
+
$ASP_BINDIR/asp_binlogviewer -l /tmp/sys -a
+
 
+
====Convert a binary log file to text file====
+
 
+
=====Specify complete path to log file=====
+
 
+
* -L : <log_file_path> is complete path to a log file.
+
 
+
* -C : <cfg_file_prefix> is prefix to cfg (metadata) file. This is an optional argument which is required when log file name and prefix of cfg file are different.
+
 
+
* -t : If log file contains TLV messages then please specify TLV file path using this option.
+
 
+
If log file is <code>/tmp/logFile</code> the corresponding text file will be <code>/tmp/logFile.txt</code>
+
 
+
'''Example''':
+
<br>When log file name and prefix of cfg files are the same (log file is <code>/tmp/sys_2007-04-18T18:58:36</code> and cfg file is <code>/tmp/sys_2007-04-18T18:58:36.cfg</code>) :
+
 
+
'''Usage''':
+
$ASP_BINDIR/asp_binlogviewer -L /tmp/sys_2007-04-18T18:58:36
+
 
+
'''Example''':
+
<br>When log file name and prefix of cfg files are different (log file is <code>/tmp/sys_2007-04-18T18:58:37</code> and cfg file is <code>/tmp/sys_2007-04-18T18:58:36.cfg</code>) :
+
 
+
'''Usage''':
+
$ASP_BINDIR/asp_binlogviewer -L /tmp/sys_2007-04-18T18:58:37 \
+
                              -C /tmp/sys_2007-04-18T18:58:36
+
 
+
====For detailed help use --h or --help====
+
 
+
*--help | -h : Display help and exit
+
 
+
'''Usage''':
+
$ASP_BINDIR/asp_binlogviewer -h
+
 
+
$ASP_BINDIR/asp_binlogviewer --help
+
 
+
====Command line log tool Output Format====
+
 
+
As the Log Server writes, this Log Tool tails the files and prints it to the Console. It automatically detects file rollover and tails the new file.
+
 
+
The output is of the form:
+
 
+
<code><pre>
+
SEVERITY STREAMNAME COMPONENTNAME SERVICEID MESSAGEID TIMESTAMP MESSAGE
+
</pre></code>
+
 
+
For example, 
+
 
+
<code><pre>
+
DEBUG applogs cpmServer_SysController_1 10 0 {Mon Jan 22 17:41:08 2007} \
+
( 0x6d 0x53 0x27 0x2a 0x97 0x22 0x1e 0x34 )
+
</pre></code>
+
 
+
where,
+
 
+
*<code>Debug</code> is the Severity
+
*<code>applogs</code> is the Stream Name
+
*<code>cpmServer_SysController_1</code> is the Component Name
+
*<code>10</code> is the Service ID
+
*<code>{Mon Jan 22 17:41:08 2007}</code> is the Time Stamp
+
*<code>0</code> is the Message ID which indicates that it is BUFFER type Binary Message. Message ID 1 is for ASCII message and it is not supported by log viewer, Message IDs other than 0 and 1 are of TLV type Binary Message.
+
*<code>( 0x6d 0x53 0x27 0x2a 0x97 0x22 0x1e 0x34 )</code> This is the hex value of each message byte separated by a space.
+
*online log viewer doesn't interpret the message part in case of BUFFER type records, it simply prints each byte of the message.
+
<br>
+
 
+
===Using Offline GUI Log Tool===
+
 
+
OpenClovis Offline Log Tool is an interactive GUI utility that allows you to view log files in a readable format and provides support for navigation, filtering and sorting of the log records. The Offline Log Tool only works on binary log files. To view ASCII log file simply open them with your favorite editor.
+
 
+
====Getting Started====
+
 
+
This provides information to launch the GUI Log Tool and helps you familiarize with its features.
+
 
+
=====How To Launch? =====
+
 
+
The Log Tool is installed in the <code>'''<installation_directory>/sdk-3.0/bin'''</code> directory during OpenClovis SDK installation.
+
 
+
If you have created the symbolic links during OpenClovis SDK installation, execute the following command:
+
<code><pre># cl-log-viewer</pre></code>
+
 
+
If you have not created the symbolic links during OpenClovis SDK installation, go to the  <code>'''<installation_directory>/sdk-3.0/bin'''</code>  directory and execute the following command:
+
<code><pre># cl-log-viewer</pre></code>
+
 
+
Alternatively, you can go to the  <code>'''<installation_directory>/sdk-3.0/logviewer'''</code>  directory and execute the following command:
+
<code><pre># ./logViewer.sh</pre></code>
+
 
+
Using 'cl-log-viewer' approach to launch the Log Tool is encouraged.
+
 
+
The '''Log Tool''' window is displayed.
+
 
+
<span id='LogToolMainWindow'></span>[[File:LogTool_MainWindow.jpg|frame|center|'''Log Tool Main Window''']]
+
<br>
+
 
+
* [[#Using Menus | Using Menus]]
+
* [[#Using Toolbar | Using Toolbar]]
+
 
+
=====Using Menus=====
+
 
+
Log Tool has the following three menus:
+
* '''File''' - The File menu has options that allow you to open a file, close the current open file, close all open files, and exit the tool.
+
* '''Tools''' - The Tools menu has options that allow you to create and save filters, access the saved filters, and configure settings for the filter location and the mapping file.
+
* '''Help''' - The Help menu provides information about the Log Tool.
+
 
+
=====Using Toolbar=====
+
 
+
The add-on icons for the Log Tool are as shown.
+
 
+
<span id='LogToolToolbar'></span>[[File:LogTool_ToolBar.jpg|frame|center| '''Log Tool Toolbar''']]
+
* '''Open Stream''' icon - Use this icon to open a Log file.
+
* '''Close Stream''' icon - Use this icon to close a Log file.
+
* '''Create Advanced Filter''' icon - Use this icon to create, apply, and save filters.
+
* '''Saved Filters''' - Use this icon to apply the saved filter to a set of records.
+
* '''Exit Log Tool''' - Use this icon to close the '''Log Tool''' window.
+
<br>
+
 
+
 
+
====Viewing Log Files====
+
 
+
This section provides information to open log files, use filters to customize views, configure the user directory, and mapping file locations.
+
 
+
'''Key Topics''' :
+
* [[#Opening Log File | Opening Log File]]
+
* [[#Sorting Log Records | Sorting Log Records]]
+
* [[#Navigating Log Records | Navigating Log Records]]
+
 
+
=====Opening Log File=====
+
 
+
To open a Log file:
+
 
+
<ol>
+
<li>From the '''File''' menu, click '''Open''' or press '''Ctrl+O'''. The '''File Selection Dialog''' dialog box is displayed.
+
<span id='File Selection Dialog'></span>[[File:LogTool_FileSelectionDialog.jpg|frame|center|'''File Selection Dialog''']]
+
<li>Enter the following:
+
* '''Log File''' - Click '''Browse'''. The '''Select Log File''' dialog box is displayed. Specify the binary Log file that you need to view. The log file has the log records in the binary format. Click '''OK'''. The '''Select Log File'''  dialog box closes.
+
<span id='Select Log File'></span>[[File:LogTool_SelectLogFile.jpg|frame|center| '''Select Log File''' ]]
+
*  '''Config File'''  - Click  '''Browse'''. The  '''Select Config File'''  dialog box is displayed. Specify the configuration file that configuration data (such as record length, component ID mapping, and stream ID mapping) for the log file. Click  '''OK''' . The  '''Select Config File'''  dialog box closes.
+
<span id='Select Config File'></span>[[File:LogTool_SelectConfigFile.jpg|frame|center|'''Select Config File''']]
+
<li>In the '''File Selection Dialog''' dialog box, click '''OK'''. The selected Log file opens in the '''Log Tool'''  window.
+
</ol>
+
 
+
Validations are performed to check if you have specified the correct files. If the files are not correct, the corresponding error message is displayed.
+
<span id='Opened Log File'></span>[[File:LogTool_OpenedLogFile.jpg|frame|center|'''Opened Log File''']]
+
 
+
=====Sorting Log Records=====
+
 
+
You can click each column header to sort the entries. Every time you click the column header, the direction of sorting changes. Sorting is applicable for the current batch of records only.
+
 
+
=====Listing Log Records=====
+
 
+
The following options are provided for listing Log Records:
+
* Click '''First''' to view the first batch of records.
+
* Click '''Next''' to view the next batch of records.
+
* Click '''Previous''' to view the previous batch of records.
+
* Click '''Last''' to view the last batch of records.
+
 
+
====Using Filters====
+
 
+
This chapter provides information on using basic filter, creating and saving filter and using saved filters.
+
 
+
A typical log file generally contains large number of entries. When you need to troubleshoot a problem, only certain entries may be relevant. For example, you may need to view logs with severity level 3. You can use filters to view the log file based on certain criteria to create customized views. You can also save the filter criteria and use it at a later time.
+
 
+
'''Key Topics''' :
+
* [[#Using Basic Filter | Using Basic Filter]]
+
* [[#Creating and Saving Filter | Creating and Saving Filter]]
+
* [[#Using Saved Filter | Using Saved Filter]]
+
 
+
=====Using Basic Filter=====
+
 
+
Basic filter comprises the drop-down lists available in the  '''Log Tool'''  window.
+
 
+
To filter records using the basic filter:
+
<ol>
+
 
+
<li>From the first drop-down list, select the filtering option. The options available are:
+
* Record Number
+
* Severity
+
* StreamId
+
* ComponentId
+
* ServiceId
+
* TimeStamp
+
* MessageId
+
* Message
+
 
+
<li>From the second drop-down list, select the type of filtering. The options in this list is displayed based on your selection in the first drop-down list.
+
 
+
<li>Based on these two selections, you can perform one of the following:
+
* In the text box, enter the filter criteria.
+
* In the value selector, specify a value.
+
 
+
If you select '''TimeStamp''' as the filter type in the first drop-down list, you need to specify the date and the time as the values.
+
 
+
<li>Click '''Filter'''. The records are filtered and displayed based on the specified criteria.
+
Figure [[#Filtered List | Filtered List]] shows the records filtered based on Severity 2.
+
<span id='Filtered List'></span>[[File:LogTool_FilteredList.jpg|frame|center|'''Filtered List''']]
+
 
+
<li>Click '''Clear''' to clear the applied filter and display the records from the start of the file.
+
</ol>
+
 
+
The following table provides information about the various filter options and the types:
+
 
+
{| align="center" border="0" cellpadding="3"
+
|+ align="bottom" | '''Filter Options and Types'''
+
|- style="color:#ffffff; background:#549cc6"
+
!style="color:#66b154; background:#09477c"| Filter Option
+
!style="color:#66b154; background:#09477c"| Filter Type
+
|- style="color:#ffffff; background:#549cc6"
+
|Message
+
|
+
* Is
+
* Is Not
+
* Contains
+
* Does Not Contain
+
* Starts With
+
* Does not start with
+
* Ends With
+
* Does not End With
+
|- style="color:#ffffff; background:#549cc6"
+
|
+
Severity
+
<br><br>
+
StreamId
+
<br><br>
+
ComponentId
+
<br><br>
+
ServiceId
+
<br><br>
+
TimeStamp
+
<br><br>
+
Record Number
+
<br><br>
+
MessageId
+
|
+
* =
+
* <
+
* >
+
* <=
+
* >=
+
* Between
+
* Range
+
|}
+
 
+
=====Creating and Saving Filter=====
+
 
+
You can create and save filters so that you can apply the saved filters to a set of records at a later time.
+
 
+
To create a filter:
+
<ol>
+
<li>From the '''Tools''' menu, click '''Advanced Filter''' or press '''Ctrl+F'''. The '''No previous Filter''' dialog box is displayed if you are creating a filter for the first time. Otherwise, the '''Advanced Filter''' window is displayed.
+
<span id='No previous Filter'></span>[[File:LogTool_NoPreviousFilter.jpg|frame|center|'''No Previous Filter''']]
+
 
+
<li>Click '''OK'''. The '''Advanced Filter''' window is displayed.
+
<span id='Advanced Filter'></span>[[File:LogTool_AdvancedFilter.jpg|frame|center|'''Advanced Filter''']]
+
 
+
<li>Enter the following information:
+
* '''Filter Name''': This is the name for the new filter.
+
* '''Filter Type''': Select the type of the filter. The available options are:
+
** AND - Select this option if you need all the criterion to be satisfied.
+
** OR - Select this option if at least one of the criteria has to be satisfied.
+
* Click '''Create Filter Criterion''' to specify the criterion in the drop-down lists.
+
* From the first drop-down list, select the filtering option.
+
* From the second drop-down list, select the type of filtering. The options in this list is displayed based on your selection in the first drop-down list.
+
* Based on these two selections, in the text box, enter the filter criteria or specify a value. If you select  '''TimeStamp''' as the filter type in the first drop-down list, you need to specify the date and the time as the values.
+
 
+
<li>Click '''Apply''' to apply the filter to the existing records.
+
<li>Click '''Save''' to save the filter.
+
</ol>
+
 
+
Click '''Remove''' to remove a filter criteria.
+
 
+
Click '''Cancel''' to cancel creating the filter.
+
 
+
=====Using Saved Filter=====
+
 
+
To use a saved filter:
+
<ol>
+
<li>From the '''Tools''' menu, click '''Saved Filters''' or press '''Ctrl+S'''. The '''Saved Filter''' dialog box displays the list of saved filters. <span id='Saved Filters'></span>[[File:LogTool_SavedFilters.jpg|frame|center|Saved Filters]]
+
 
+
<li>Select the filter that you need to apply and click '''Apply'''. The selected filter is applied to the existing records.
+
 
+
<li>To add more filters, click '''Add'''. The '''Advanced Filter''' window is displayed. For information to create and save a filter, refer to the section [[#Creating and Saving Filter | Creating and Saving Filter]].
+
 
+
<li>To remove a saved filter, select the filter and click '''Remove'''. The selected filter is removed from the list.
+
 
+
<li>Click '''OK''' to close the '''Saved Filters''' dialog box.
+
 
+
<li>Click '''Cancel''' to cancel the process of applying a saved filter.
+
</ol>
+
 
+
====Configuring User Directory and Mapping File Location====
+
 
+
To configure the location for user-defined filters and mapping files:
+
<ol>
+
<li>From the '''Tools''' menu, click '''Settings''' or press '''Ctrl+T'''. The '''Settings''' window is displayed.
+
<span id='Settings'></span>[[File:LogTool_ConfigureLocation.jpg|frame|center|'''Settings''']]
+
 
+
<li>Enter the following information:
+
* '''User Directory''': This is the directory where the created filters are saved. This must be an existing directory.
+
* '''TLV Mapping File''': This is the directory where the mapping file for the MessageId is stored. A log file represents the MessageIds in a sequence of bytes. The mapping file contains the string representation for these MessageIds. If you specify a mapping file, then the corresponding string representation for the MessageId is displayed when you open the Log file using the Log Tool. If you do not specify the mapping file, then the MessageId is displayed as a sequence of bytes.
+
<li>Click '''Apply''' to apply the configured locations to the current open Log file.
+
<li>Click '''OK''' to save the settings.
+
</ol>
+
 
+
Click '''Restore Defaults''' to restore the default locations.
+
 
+
Click '''Cancel''' to cancel the settings.
+
 
+
====Closing Log File(s)====
+
 
+
To close a Log file, from the '''File''' menu, click '''Close''' or press '''Ctrl+C'''. The Log file that is currently open is closed.
+
 
+
To close all open Log files, from the '''File''' menu, click '''Close All''' or press '''Ctrl+Shift+C'''. All Log files that are open are closed.
+
 
+
====Exiting Log Tool====
+
 
+
To exit from Log Tool, from the  '''File'''  menu, click  '''Exit''' tor press  '''Ctrl+X''' . The  '''Log Tool'''  window closes.
+

Revision as of 21:29, 13 February 2012

http://www.buyxanaxonlinepill.com/ buy xanax online - xanax

http://www.buyxanaxonlinepill.com/ buy xanax online - online xanax