Closed Lumirris closed 7 years ago
@Lumirris thanks for bringing up this issue. Unfortuntely, it's not easy to modify interface at this time as both packages are being used by community in production environment. However, ugly solution is to not use both packages at same time. Both packages are providing more or less same functionality.
I know this issue is a bit dated, but another way around the is to just call the extension method directly, like so:
Serilog.EnvironmentLoggerConfigurationExtensions.WithMachineName(logger.Enrich);
OR
Serilog.ContextLoggerConfigurationExtension.WithMachineName(logger.Enrich);
That way you can still continue to use both libraries. Posting this for anyone else who comes across this issue.
The
WithMachineName
method in:https://github.com/saleem-mirza/serilog-enrichers-context/blob/master/src/Serilog.Enrichers.Context/ContextLoggerConfigurationExtension.cs
has the same signature as in
https://github.com/serilog/serilog-enrichers-environment/blob/master/src/Serilog.Enrichers.Environment/EnvironmentLoggerConfigurationExtensions.cs
This seems to (only recently?) prevent you from using both packages at the same time, because there's an ambiguity build error.