How to log objects without xml or binary serialization

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
we have custom classes and we need them serialized. We have too many custom object types and using xml serialization takes a very long time when we dont know the object type, so we dont use that. What we basicaly need is, to log the object in plain text,
this is for logging and auditing purposes. Serialization or later de-serialization is not needed.
So we used reflection and generated an xml string, which has objects, their properties and theri values. But an object property can also be another custom object even a generic list so recursive part was a real pain .... -Not to mention about lazy initialized
properties.-
I thought maybe System.Xml.Linq can help us, or maybe there is a better way to do this, so any keywords or comments are appreciated. All we need is understandable text for each property that has a value.
Any suggestions?

Thanks

View the full article
 
Back
Top