Closed daiplusplus closed 9 months ago
This issue was marked as stale since it has not been active for a long time
I did try implementing my own destructuring policy
@daiplusplus Indeed, custom destructuring policy is the right way here. In your example of configuration there is a custom attribute, but the rest of the settings are explicitly set, and not through this attribute. This will only complicate the design and create many questions. The custom destructuring policy will better solve your problem.
My frontend projects (which reference Serilog and Destructurama) have dependencies on libraries which expose objects containing sensitive data, however I'm not able to annotate the types in those libraries with the Destructurama
[NotLogged]
and[LogMasked]
attributes. Incidentally the backend library I'm using right now does annotate sensitive data with its ownCompanyName.ProductName.SensitiveDataAttribute
class.I did try implementing my own destructuring policy but quickly found myself out of my depth.
I realise a better solution is if Destructurama allow us to specify custom attributes to respect for logging and masking, something like:
This design allows a non-parameterised custom attribute type for
LogMasked
while default values forText
,ShowFirst
,ShowLast
, andPreserveLength
can be specified.