first usage

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

Moderator: admin

Post Reply
bobjenkin
Posts: 1
Joined: Wed Nov 01, 2017 3:11 pm

first usage

Post by bobjenkin » Wed Nov 01, 2017 3:13 pm

I have log files created using log4j with the following format %d{dd MMM yyyy HH:mm:ss} [%t] %-5p %c %x - %m

I have not figured out how to actually load a log file without getting no parser available for log file

any help would be greatly appricated

admin
Site Admin
Posts: 419
Joined: Sun Dec 17, 2006 10:30 pm

Re: first usage

Post by admin » Thu Nov 02, 2017 12:05 am

Hello,

Here are the steps to create a Parser for such logs:
  1. Go to menu "File" > item "Configure Log Parsers..."
  2. Click on the green "+" button at the right to create a Parser (or double-click on the Parser to edit, if you already have tried creating a Parser)
  3. Select the tab "Log4j/Logback pattern Parser"
  4. Give a name to your Parser (text field at the top of the window)
  5. Paste your Log4j pattern in the text field "Log4j or Logback pattern" (i.e. "%d{dd MMM yyyy HH:mm:ss} [%t] %-5p %c %x - %m")
  6. Paste a few lines of your logs in the text pane "Parser test"
  7. If no log entries are displayed at the bottom of the window ("Parsed entries"), then here are a few things to check:
    • the number of white-space characters around the log level: you shall have "YourThread] " and then exactly 5 characters to represent the log level, padding with white-space characters around it if needed (e.g. "INFO " instead of "INFO"), and then " YourClass" after this log level
    • the locale used to represent the "Month" in your date: since you're using "MMM" in yout pattern, it means that the name of the month should be complete, so at the center of the window, select the language used in your logs to represent the month
  8. When the parser looks fine, click on the "OK" button of both windows and open your log file using menu "File" > item "Open logs..."
If it still doesn't work: check if the 100 first lines of your log file contains at least 2 log entries: if not, increase the value "Switch to next parser when no entry found after XXX lines in file" at the bottom of the Parsers window you had at step 2 above (if the 2 first log messages contain a great number of new line characters, it may happen).
If it still doesn't work: please paste here in this forum the first log entries of your log file

Xavier

Post Reply