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
first usage
Moderator: admin
Re: first usage
Hello,
Here are the steps to create a Parser for such logs:
If it still doesn't work: please paste here in this forum the first log entries of your log file
Xavier
Here are the steps to create a Parser for such logs:
- Go to menu "File" > item "Configure Log Parsers..."
- 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)
- Select the tab "Log4j/Logback pattern Parser"
- Give a name to your Parser (text field at the top of the window)
- 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")
- Paste a few lines of your logs in the text pane "Parser test"
- 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
- 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: please paste here in this forum the first log entries of your log file
Xavier