-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception when reading Serilog-clef-files with enrichment using "Object" as the key #1629
Comments
Hi @opheoHeidrich , I'm able to reproduce it. Will update |
I think using more unique keys for predefined columns with Analogy logic would help. For example using a prefix like "Analogy.". After looking a bit I would expect some problems when the log contains any of the keys used in Analogy.CommonControls.Utils.CreateRow. Most would not be as extreme as the cast-exception when using "Object" as key, but the other keys might still impact expected behaviour of those 'special' columns. |
@opheoHeidrich yeah, this is the reason. I'll probably use GUID so there will be very low probably of Collisons |
released the new version with the fix :) |
Describe the bug
A .clef file with the content:
{"@t":"2023-02-13T09:43:22.6297404Z","@mt":"This is a test!","@l":"Warning","Object":["Object1.ToString() Result","Object2.ToString() Result"]}
will result in an exception when read.
From a first analysis this exceptions happens in "Analogy.CommonControls.UserControls.LogMessagesUC.LogGridView_RowStyle" when direct casting the CellValue of the "Object" column into an AnalogyLogMessage. In the test log message the value is a string, wich can not be cast into an AnalogyLogMessage.
ℹ Computer information
📝 Provide detailed reproduction steps (if any)
✔️ Expected result
Log can be opened.
❌ Actual result
System.InvalidCastException
HResult=0x80004002
Message=Unable to cast object of type 'System.String' to type 'Analogy.Interfaces.AnalogyLogMessage'.
Source=Analogy.CommonControls
StackTrace:
at Analogy.CommonControls.UserControls.LogMessagesUC.logGrid_FocusedRowChanged(Object sender, FocusedRowChangedEventArgs e) in C:\git\repos\Analogy.LogViewer\Analogy.CommonControls\UserControls\LogMessagesUC.cs:line 3253
at DevExpress.XtraGrid.Views.Grid.GridView.RaiseFocusedRowChanged(Int32 prevFocused, Int32 focusedRowHandle)
at DevExpress.XtraGrid.Views.Base.ColumnView.DoChangeFocusedRowInternal(Int32 newRowHandle, Boolean updateCurrentRow)
at DevExpress.XtraGrid.Views.Grid.GridView.OnCurrentControllerRowChanged(CurrentRowEventArgs e)
at DevExpress.Data.BaseGridController.OnCurrentControllerRowChanged()
at DevExpress.Data.Helpers.NewListSourceRowKeeper.RestoreCore()
at DevExpress.Data.DataController.OnPostRefresh(Boolean useRowsKeeper)
at DevExpress.Data.CurrencyDataController.OnPostRefresh(Boolean useRowsKeeper)
at DevExpress.Data.DataController.DoRefresh(Boolean useRowsKeeper)
at DevExpress.Data.DataController.OnBindingListChangedCore(ListChangedEventArgs e)
at DevExpress.Data.BaseGridController.OnBindingListChangedCore(ListChangedEventArgs e)
at DevExpress.Data.DataController.OnBindingListChanged(ListChangedEventArgs e)
at DevExpress.Data.CurrencyDataController.RaiseOnBindingListChanged(ListChangedEventArgs e)
at System.Data.DataView.OnListChanged(ListChangedEventArgs e)
📷 Screenshots
The text was updated successfully, but these errors were encountered: