You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In class pl.otros.logview.parser.json.JsonExtractor, function mapToLogData, every value that is extracted from the json object has a default - except for dateString.
I don't know if this is intended behavior (I think it would be better to use some default date or something), but in any case I think that the expected behavior shouldn't be an NPE - I think it should either be dropped silently or at least a dedicated exception (e.g. "message without date") should be used so that the cause would be clear.
By the way the user has no way of knowing what happens (since NPEs don't get logged in the internal log), so the user doesn't know if or how many log entries were dropped silently.
The text was updated successfully, but these errors were encountered:
Correction: The user actually does have a way of knowing it (in the JSON pattern parser it says "0 events parsed" and when live, the bottom status bar flashes red with some error), but the cause isn't clear.
Thanks for investigating. Log events without date are problematic because OLV have to assume date.
For other log parser I use current time if timestamp is missing. OLV have to do the same for Json log parser.
I was not expecting that log events in Json/XML format will not have date.
NP :) just thought I'd give a heads up instead of silently fixing it for myself.
BTW about the other issue I opened (about the datetime), I solved it by adding a custom datetime field to the JSON object generated by log4j2 (and a custom json parser that gets the date from that field). The configuration:
In class pl.otros.logview.parser.json.JsonExtractor, function mapToLogData, every value that is extracted from the json object has a default - except for dateString.
otroslogviewer/OtrosLogViewer-app/src/main/java/pl/otros/logview/parser/json/JsonExtractor.java
Line 173 in bbf386c
I don't know if this is intended behavior (I think it would be better to use some default date or something), but in any case I think that the expected behavior shouldn't be an NPE - I think it should either be dropped silently or at least a dedicated exception (e.g. "message without date") should be used so that the cause would be clear.
By the way the user has no way of knowing what happens (since NPEs don't get logged in the internal log), so the user doesn't know if or how many log entries were dropped silently.
The text was updated successfully, but these errors were encountered: