Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to read tags from App.config #45

Open
stochmal opened this issue Jan 12, 2021 · 0 comments
Open

unable to read tags from App.config #45

stochmal opened this issue Jan 12, 2021 · 0 comments

Comments

@stochmal
Copy link

stochmal commented Jan 12, 2021

<add key="serilog:write-to:DatadogLogs.tags" value="name:dev,owner:trading,application:fti" />

trying to read above entry generates error:

System.InvalidCastException
HResult=0x80004002
Message=Invalid cast from 'System.String' to 'System.String[]'.
Source=mscorlib
StackTrace:
at System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider)
at System.String.System.IConvertible.ToType(Type type, IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType)
at Serilog.Settings.KeyValuePairs.SettingValueConversions.ConvertToType(String value, Type toType)
at Serilog.Settings.KeyValuePairs.KeyValuePairSettings.ConvertOrLookupByName(String valueOrSwitchName, Type type, IReadOnlyDictionary2 declaredSwitches) at Serilog.Settings.KeyValuePairs.KeyValuePairSettings.<>c__DisplayClass26_0.<ApplyDirectives>b__1(<>f__AnonymousType32 <>h__TransparentIdentifier0)
at System.Linq.Enumerable.<>c__DisplayClass7_03.<CombineSelectors>b__0(TSource x) at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Serilog.Settings.KeyValuePairs.KeyValuePairSettings.ApplyDirectives(List1 directives, IList1 configurationMethods, Object loggerConfigMethod, IReadOnlyDictionary2 declaredSwitches)
at Serilog.Settings.KeyValuePairs.KeyValuePairSettings.Configure(LoggerConfiguration loggerConfiguration)
at Serilog.Configuration.LoggerSettingsConfiguration.Settings(ILoggerSettings settings)
at Serilog.Configuration.LoggerSettingsConfiguration.KeyValuePairs(IEnumerable`1 settings)
at Serilog.Settings.AppSettings.AppSettingsSettings.Configure(LoggerConfiguration loggerConfiguration)
at Serilog.Configuration.LoggerSettingsConfiguration.Settings(ILoggerSettings settings)
at Serilog.AppSettingsLoggerConfigurationExtensions.AppSettings(LoggerSettingsConfiguration settingConfiguration, String settingPrefix, String filePath)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant