Multi-line log entries

Notes, tips, and other usefull things on how to use LogMX

Moderator: admin

Post Reply
xplodersuv
Posts: 3
Joined: Thu Nov 06, 2008 4:10 am

Multi-line log entries

Post by xplodersuv »

Our logs don't exactly follow the one-line-per-event standard so sometimes out logs look like this:

INFO 12/23/2008 12:45:03 AM MyClass: object {
attr1 = 123
...etc...
}
INFO 12/23/2008 12:45:04 AM MyClass: Next statement

The problem is that logmx only shows the first line, not the subsequent lines between logging statements. I know that I can probably get around this using the XMLLayout, but everyone else on my team prefers to leave the log as is.
admin
Site Admin
Posts: 555
Joined: Sun Dec 17, 2006 10:30 pm

Post by admin »

Hello,

Many log formats use several lines for a single log entry, and LogMX handles these multi-lines formats.
Could you tell me what do you mean by "logmx only shows the first line":
  • if you mean that LogMX parses all entry lines but only the first line of entry Message is displayed, due to cells height in the entries table
    => you can modify this cell height in menu "Tools" > "Options" > "Display" > "Right entries table row height"
  • if you mean that LogMX parses only the first line of each entry, and the entry Message is truncated, even in the entry message Pane at the bottom of the main window
    => you don't use a suitable Log Parser. LogMX can use any Log Parser you create, which can be a "Simple Parser", "Log4jPattern Parser", or a "Java Class Parser". Please tell me the Parser you use (if you didn't create your Parser yourself, the Parser name is displayed in the main window status bar at the bottom once the file is loaded)
In the meantime, a suitable parser for your example is a Log4jPattern with pattern:

Code: Select all

%p %d{dd/MM/yyyy HH:mm:ss a} %c %m
To test it, go to menu "Tools" > "Options" > "Parser" > Green "+" button > tab "Log4jPatternParser" and copy/paste the pattern above.

Xavier
Post Reply