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
From the following log, I want to remove the field "HelpLink.ProdName", which is a property of "Data" and "Data" itself is a direct property of ExceptionDetails.
I used the filter new DestructuringOptionsBuilder().WithFilter(new IgnorePropertyByNameExceptionFilter("HelpLink.ProdName")). It did not work.
In the above example, the filed "Data" can be removed using IgnorePropertyByNameExceptionFilter because "Data" is a direct property of "ExceptionDetails". However, any property under the direct property of "ExceptionDetails" cannot be removed.
Worse scenarios
In another scenario, an exception of type DBConcurrencyException was logged. It had an inner exception of type "OptimisticConcurrencyException". The "StateEntries" property of inner exception, contained over 12000 lines in the log record.
Such lengthy properties are not needed to be logged. We could easily get more than enough information from the other details of the exception.
Feature Request
There should be an option to filter out any property that's the direct property of "ExceptionDetails". e.g. "HelpLink.ProdName" in the above example.
The text was updated successfully, but these errors were encountered:
It seems Serilog.Expression either include or exclude the whole property. Could it be possible to truncate the long property? Since we may still want some information from it.
Describe the feature
Problem
From the following log, I want to remove the field "HelpLink.ProdName", which is a property of "Data" and "Data" itself is a direct property of ExceptionDetails.
What I did
I used the filter
new DestructuringOptionsBuilder().WithFilter(new IgnorePropertyByNameExceptionFilter("HelpLink.ProdName"))
. It did not work.In the above example, the filed "Data" can be removed using
IgnorePropertyByNameExceptionFilter
because "Data" is a direct property of "ExceptionDetails". However, any property under the direct property of "ExceptionDetails" cannot be removed.Worse scenarios
In another scenario, an exception of type DBConcurrencyException was logged. It had an inner exception of type "OptimisticConcurrencyException". The "StateEntries" property of inner exception, contained over 12000 lines in the log record.
Such lengthy properties are not needed to be logged. We could easily get more than enough information from the other details of the exception.
Feature Request
There should be an option to filter out any property that's the direct property of "ExceptionDetails". e.g. "HelpLink.ProdName" in the above example.
The text was updated successfully, but these errors were encountered: