How to make a pattern failed is the priority is Unknown


Author
Message
Laurent
Laurent
New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)
Group: Forum Members
Posts: 2, Visits: 7
I am using the LogViewPlus on the Unreal logs and I have setup the following patterns
[%d{yyyy.MM.dd-HH.mm.ss:fff}][%3t]%c: %p: %m%n
[%d{yyyy.MM.dd-HH.mm.ss:fff}][%3t]%c: %m%n


The idea is if the priority is not set for the log line, than consider everything after the Logger to be the message.
In practice when there is not priority and the message contains ": " the the first half of the message is treated as the priority
For example
[2023.02.17-07.06.04:011][  0]LogInit: Display: Engine is initialized. Leaving FEngineLoop::Init()
[2023.02.17-07.06.04:011][ 0]LogLoad: (Engine Initialization) Total time: 38.70 seconds

is parsed as 

I would like the second line to be
17 Feb 2023    7:06:04.011    LogLoad        NONE        (Engine Initialization) Total time: 38.70 seconds


I am guessing the feature I am looking for is: "Enforce exact match for priority"
LogViewPlus Support
LogViewPlus Support
Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.7K
Hi Laurent,

We had another user report a similar issue awhile back.  We introduced a new feature to specify the priority levels in advance with something like:

[%d{yyyy.MM.dd-HH.mm.ss:fff}][%3t]%c: %p{-expectedValues:info,warn,error}: %m%n
[%d{yyyy.MM.dd-HH.mm.ss:fff}][%3t]%c: %m%n

Where "info,warn,error" is a comma separated list of known priority levels.  This list will need to be modified for your logs.

It looks like we have not yet had user confirmation that this approach resolves the issue.  If you find this approach helps please do let me know.  Also, if you share your configuration, it might help the next Unreal user.

Hope that helps,

Toby
Laurent
Laurent
New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)
Group: Forum Members
Posts: 2, Visits: 7
Thank you Toby,

Setting the expected values works great. the "UNKNOWN" are gone and only "NONE" are left.
Where can I find documentation on similar features than "expectedValues"?

My current configuration is
[%d{yyyy.MM.dd-HH.mm.ss:fff}][%3t]%c: %p{-expectedValues:VeryVerbose,Verbose,Display,Warning,Error}: %m%n
[%d{yyyy.MM.dd-HH.mm.ss:fff}][%3t]%c: %m%n
%c: %p{-expectedValues:VeryVerbose,Verbose,Display,Warning,Error}: %m%n
%m, %d{MM/dd/yy HH:mm:ss}%n

There are still some lines not parsed as single log line. They are minor logs but I am going to refine the patterns.
A follow up question if I want to add pattern like
%c: %m%n

How can I make sure it ignore the log lines starting with whitespaces?

LogViewPlus Support
LogViewPlus Support
Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.7K
Glad that helped Laurent.

I have just added the documentation on specifier arguments.  That documentation should have been created awhile ago, apologies for any confusion.

LogViewPlus requires all log entries to have a timestamp, so the last two configurations you have defined are probably not going to add value.  I think your parser configuration would be better defined as just the first two lines:

[%d{yyyy.MM.dd-HH.mm.ss:fff}][%3t]%c: %p{-expectedValues:VeryVerbose,Verbose,Display,Warning,Error}: %m%n
[%d{yyyy.MM.dd-HH.mm.ss:fff}][%3t]%c: %m%n

> some lines not parsed as single log line

LogViewPlus parses log entries - not lines.  It is fine for log entries to span multiple lines or contain whitespace lines.  There is no way to override this behaviour.

The newline specifier (%n) is a bit confusing in this case because it is flexible.  It could mean a new line if the parser configuration continues across another line, or it could indicate the end of the log entry.  In the parser configurations above, it means "end of log entry".  LogViewPlus will scan for a new date to indicate the start of the next log entry and append invalid lines to the last specifier (%m in this case).

If you would like to view messages as one line in the log entry grid, you could consider changing your grid view settings.

Hope that helps,

Toby



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Login

Explore
Messages
Mentions
Search