Unhandled Exception: System.InvalidCastException: Invalid cast from 'System.String' to 'Serilog.Sinks.Slack.Core.SlackSink+RenderMessageMethod'.
at System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider)
at Serilog.Settings.Configuration.StringArgumentValue.ConvertTo(Type toType, IReadOnlyDictionary`2 declaredLevelSwitches)
at Serilog.Settings.Configuration.ConfigurationReader.<>c__DisplayClass20_0.<CallConfigurationMethods>b__3(<>f__AnonymousType7`2 <>h__TransparentIdentifier0)
What is the correct syntax of renderMessageImplementation in the appsettings.json to do this? I tried looking at the ConvertTo code but am not sure what I'm missing.
In the readme it shows how to provide a custom renderer when configuring the sink in code:
However, I'm struggling to do the same using the serilog configuration extension:
What is the correct syntax of
renderMessageImplementation
in theappsettings.json
to do this? I tried looking at theConvertTo
code but am not sure what I'm missing.