LogViewPlus Support

How to skip log entries that cannot be parsed

https://www.logviewplus.com/forum/Topic1494.aspx

By Ace - 4 Jul 2022

My IDE outputs some logs that do not match my formatted logs.
This causes LogViewPlus to not be able to open the file.
Is there a way to simply have the application skip entries it cannot parse?

thanks,
David
By LogViewPlus Support - 5 Jul 2022

Hi David,

Short of writing a custom parser, there is no way to skip log entries. 

I would expect LogViewPlus to handle an unknown log entry by appending it to the previous log entry.  In this way, the data can still be found with a text search.  I would certainly expect LogViewPlus to be able to open the log file.  Are you using the latest version of LogViewPlus?  What happens when the log file fails to open?

If you want to parse the alternate format, you might want to consider parsing with a multi-pattern.

Hope that helps,

Toby
By Ace - 5 Jul 2022

Thanks Toby...

Here is the part of the log that is giving me trouble:
The log starts with these series of characters, then newline, then my logs start...


How do I write a pattern for this?

The pattern for my logs is:
%d{yyyy-MM-dd %H:mm:ss}    %S{Type}    %S{Source}    %S{Msg}%n

Now I want to add a new pattern for:


I tried regex for exactly 10 chars - I want to ignore any line with exactly 10 chars.
/^..........$/gm

But if I check the "regex" i would think my original pattern would stop working.

Regardless, it tells me "minimum of two elements must be found"

any approach you would take?
By LogViewPlus Support - 5 Jul 2022

The text:


Cannot be used to represent a log entry because no timestamp can be determined.

However, I don't think this text is causing the problem.  LogViewPlus should be appending this text to the next (or first) log entry.