Closed denis-ivanov closed 2 years ago
Can you not add typeof(Type)
to the existing list here:
ObjectTypeConverters = new List<ObjectTypeConvert>()
{
new ObjectTypeConvert(typeof(System.Reflection.Assembly)), // Skip serializing all types in application
new ObjectTypeConvert(typeof(System.Reflection.Module)), // Skip serializing all types in application
new ObjectTypeConvert(typeof(System.Reflection.MemberInfo)), // Skip serializing all types in application
new ObjectTypeConvert(typeof(System.IO.Stream)), // Skip serializing Stream properties, since they throw
new ObjectTypeConvert(typeof(System.Net.IPAddress)), // Skip serializing IPAdress properties, since they throw when IPv6 address
};
@snakefoot , done
Why was this closed? Was really hoping to get this fix ASAP, since passing exception object to LogError triggers this issue..
It does not solve issue. You can create your own PR
@denis-ivanov Not sure why the pull-request was closed, but while waiting for a release then you can do this:
<target xsi:type="ElasticSearch" uri="http://localhost:9200/">
<typeconverter objectType="System.Type" />
</target>
Which will force ToString for System.Type
Alternative you can configure maxRecursionLimit="1"
, that should protect you against the very fragile Elastic-Json-Serializer.
Checklist
This PR fixed the following error: