Log Level may or may not exist


Author
Message
samaursa
samaursa
Gaining Respect (107 reputation)Gaining Respect (107 reputation)Gaining Respect (107 reputation)Gaining Respect (107 reputation)Gaining Respect (107 reputation)Gaining Respect (107 reputation)Gaining Respect (107 reputation)Gaining Respect (107 reputation)Gaining Respect (107 reputation)
Group: Forum Members
Posts: 17, Visits: 82
Using Unreal Engine, the logs may or may not have the log level in them.

For example, the following are all valid log entries in Unreal Engine

[2022.04.23-23.24.34:815][  0]LogWindows: DebugString: PrimaryIsNotTheChoosenAdapter PrimaryIsNotTheChoosenAdapter PrimaryIsNotTheChoosenAdapter GetVideoDriverDetailsInvalid PrimaryIsNotTheChoosenAdapter
[2022.04.23-23.24.38:686][ 0]LogPython: Warning: 'xxxxxxxxx' and 'xxxxxx' have the same name (xxxxxxxxx) when exposed to Python. Rename one of them using 'ScriptName' meta-data.
[2022.04.23-23.27.39:787][864]LogUObjectHash: Compacting FUObjectHashTables data took 1.54ms
[2022.04.23-23.27.43:549][977]SourceControl: fatal: unable to get credential storage lock in 1000 ms: No such file or directory


As you can see, the entries are fairly inconsistent. When doing my own log entries, I made sure to be a bit more consistent. However I cannot seem to come up with a good parser for the inconsistent Unreal (and plugins) logs. I would like the log level to be UNKNOWN when there is no log level found. Currently, because the parser expects a colon and does not find one in log entries without a log level, it combines log entries of 2 (or more) lines into one.

For example, in the following screenshot, because the log level does not exist in the message, the parser gets confused and merged 3 log entries into one.



Edited 2 Years Ago by samaursa
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 Samaursa,

When parsing a log file, LogViewPlus requires all log entries to have the same format.  Optional fields are not supported.

However, you can use multiple parsing patterns.  This technique works best when the more complicated pattern is defined first and the appropriate pattern can be determined by looking at the first line. 

For example, if I use the pattern:

[%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



You can see that the log level is set to NONE in line 3.



Hope that helps,

Toby

samaursa
samaursa
Gaining Respect (107 reputation)Gaining Respect (107 reputation)Gaining Respect (107 reputation)Gaining Respect (107 reputation)Gaining Respect (107 reputation)Gaining Respect (107 reputation)Gaining Respect (107 reputation)Gaining Respect (107 reputation)Gaining Respect (107 reputation)
Group: Forum Members
Posts: 17, Visits: 82
Thank you Toby. The multiple parser pattern worked great!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Login

Explore
Messages
Mentions
Search