!--a11y-->
Command Line Log Viewer 
The file lv.bat is delivered with the Standalone Log Viewer and is used to print log and trace files written by the SAP logging API with ListFormat, in a human readable format.
The tool supports two main operation modes:
· printing whole files
· printing log records from some source files as they are written (this resembles the tail -f command)
usage: lv.bat source [-o outfile] [-t] [-i] [-e]
[-l location name] [-c category name]
[-d date] [-s severity] [-f format]
General Options
Options |
Description |
source |
Path to a log directory or a single file. Note that if you specify a directory as the value of the source argument then Log Viewer tries to dump the content of all files in that directory. But this will only work if all the files are written in ListFormat. Multiple values must be separated by space. |
-i[ndex] |
When this switch is set and a list of files has been given as source each log record is tagged with an index number. This number references the file in the source file list from where the log record originated. If only one file is specified for reading, this flag will be ignored. |
-o[utfile] <outfile> |
The filename (outfile) where to write the output. Always writes the complete file and terminates automatic. |
-t[ail] |
When this switch is set the lv tool will not print the whole content of the source file or files but will print each new log record as they are written to the corresponding file. This option does not work in J2EE command console. |
-e[ventlog] |
Enable Logging API log. Logging API messages will be written to the loggingAPI.log and loggingAPI.trc file |
-h[elp] |
Print this help text. |
-v[ersion] |
Print version information |
-format <format pattern> |
With this option the format of a message can be customized. Default pattern = %d %t %s %m |
Format Pattern Elements
%m[n,a] print the message <n> is the maximum width of the field default is -1 char <a> is the alignment. <l>eft, <c>enter, <r>ight - default is <l>eft %d[n,a] print the date of the message <n> is the maximum width of the field default is 10 char <a> is the alignment. <l>eft, <c>enter, <r>ight - default is <l>eft %t[n,a] print the time of the message <n> is the maximum width of the field default is 12 char <a> is the alignment. <l>eft, <c>enter, <r>ight - default is <l>eft %s[n,a] print the severity of the message <n> is the maximum width of the field default is 8 char <a> is the alignment. <l>eft, <c>enter, <r>ight - default is <l>eft %g[n,a] print the guid of the message <n> is the maximum width of the field default is 35 char <a> is the alignment. <l>eft, <c>enter, <r>ight - default is <l>eft %l[n,a] print the location of the message <n> is the maximum width of the field default is 35 char <a> is the alignment. <l>eft, <c>enter, <r>ight - default is <l>eft %c[n,a] print the category of the message <n> is the maximum width of the field default is 35 char <a> is the alignment. <l>eft, <c>enter, <r>ight - default is <l>eft |
Filters Options
Filter |
Description |
-l[ocation] <location name> |
Print all the messages with the given location name |
-c[ategory] <category name> |
Print all the messages with the given category name |
-d[ate] <date value> |
Print all messages with this or a later time stamp Use format (dd.MM.yyyy HH:mm:ss) |
-s[everity] <value> DEBUG|PATH|INFO|WARNING|ERROR|FATAL |
Display only records with severity >= value (severities are ordered with ascending severity from DEBUG to FATAL) |
· To use the command line Log Viewer, just start lv.bat.
· To dump a single file enter the command lv.bat <complete path to file including file name>. This will dump the complete file.
· To see the whole content of a log directory specify a directory as argument, for example,lv.bat <path to directory>.

This will work only if the content is only list logs.
· To print log messages as they are written to a file use the -t switch, for example, lv.bat <path to file> -t.
