Columnizers

LogExpert

Columnizers

A columnizer can split the logfile into well defined columns. So a columnizer must know the format of the logfile. Because there are many different logfile formats out there, LogExpert cannot handle all of them. But you can provide your own columnizer by writing a plugin.

To select a columnizer for the current log file Choose "Columnizer" from the Options menu.

If you check the "Apply to all open files" option, the selected columnizer will be applied to all open log files.

LogExpert stores a history of log files and its selected columnizers. So when you load a file again, the last selected columnizer is enabled automatically.

The Config button is only enabled if the Columnizer provides an own configuration dialog. The columnizers shipped with LogExpert don't have configuration dialogs.

Timeshift support

A columnizer can optionally support timeshift. That means that the columnizer is capable of parsing the date/time values of a line in the logfile. The columnizer can add an offset to the displayed date/time value. Timeshift support is needed for the so called Timeshift feature and for navigating via date/time control.

Built-in columnizers

There are 4 built-in columnizers. 3 of them support Timeshift.

Timestamp columnizer

This columnizer splits the line into 3 fields: date, time and the rest of the log message. The columnizer expects a date at position 0 of the line followed by a time (separated by space).

Following formats are recognized:

 dd.MM.yyyy HH:mm:ss.fff

 dd.MM.yyyy HH:mm:ss,fff

 dd.MM.yyyy HH:mm:ss

 yyyy/MM/dd HH:mm:ss.fff

 yyyy/MM/dd HH:mm:ss,fff

 yyyy/MM/dd HH:mm:ss

 yyyy.MM.dd HH:mm:ss.fff

 yyyy.MM.dd HH:mm:ss,fff

 yyyy.MM.dd HH:mm:ss

 yyyy-MM-dd HH:mm:ss

 yyyy-MM-dd HH:mm:ss.fff

 yyyy-MM-dd HH:mm:ss,fff

 dd MMM yyyy HH:mm:ss

 dd MMM yyyy HH:mm:ss.fff

 dd MMM yyyy HH:mm:ss,fff 

 dd.MM.yy HH:mm:ss.fff 

 yyyy-MM-dd HH:mm:ss:ffff 

Here you can see an example. The first screenshot shows the original log file content (as shown when using no columnizer). The second screenshot shows the same log file using the Timestamp columnizer.

 

Webserver CLF columnizer

This columnizer expects lines to be formatted according the the CLF (Common logfile format) used by many web servers.

 

CSV Columnizer

The CSV Columnizer splits files with comma separated fields into columns. The number of columns is determined from the file content.

You can configure the Columnizer by clicking the Config-Button on the Columnizer-Chooser dialog.

Delimiter char

The character which separates the fields. In most CSV files this will be comma or semicolon. Excel uses a semicolon.

Quote char

The character which is used to quote fields, so it can contain delimiter chars in its content. Excel uses " (at least in the german version)

Escape char

Character letting insert quotation characters inside a quoted field. Excel uses " (at least in the german version)

Comment char

When a line starts with this character, its treated as non-existing

First line contains names

Check this option, if the first line in the file contains the names of the fields. The columns in LogExpert will be named like this field names. Also the first line isn't displayed as file content.

 

Log4j XML Columnizer

The Log4j XML Columnizer will parse log files produced by log4j when using XMLLayout. In XMLLayout every log entry is packed in a XML structure like this:

<log4j:message><![CDATA[This is log message number 0]]></log4j:message>

  <log4j:locationInfo class="de.har.log4jtest.Main" method="main" file="Main.java" line="28"/>

</log4j:event>

The Columnizer can parse this XML structures and will display the log entries in a human readable way just like normal text log files:

In the Columnizer configuration you can select the field to display and the maximum length.

The Log4j XMl Columnizer source code is provided the LogExpert SDK. You can use it as a starting point to create XML Columnizers for other log file formats.