We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
null
Using serilog-enrichers-environment v2.1.3 with FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim on docker
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim
MachineName appears to be null, where the code below returns both inquiries with the correct value.
Console.WriteLine($"HOSTNAME: {Environment.GetEnvironmentVariable("HOSTNAME")}\nMACHINENAME: {Environment.MachineName}");
"Serilog": { "MinimumLevel": { "Default": "Debug" }, "Using": [ "Serilog.Sinks.Seq" ], "WriteTo": [ { "Name": "Seq", "Args": { "serverUrl": "http://localhost:5341" } } ], "Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId", "WithProcessId" ], "Properties": { "Configuration": "DEVELOPMENT", "ApplicationName": "Test" }
public class Program { public static async Task Main(string[] args) { Console.WriteLine($"HOSTNAME: {Environment.GetEnvironmentVariable("HOSTNAME")}\nMACHINENAME: {Environment.MachineName}"); await Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder(args) .UseSerilog((hostingContext, loggerConfiguration) => loggerConfiguration .ReadFrom.Configuration(hostingContext.Configuration) ) .ConfigureServices((hostContext, services) => { services.AddMyService(hostContext.Configuration); }) .RunConsoleAsync(); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Using serilog-enrichers-environment v2.1.3 with
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim
on dockerMachineName appears to be
null
, where the code below returns both inquiries with the correct value.appsettings.json
Program.cs
The text was updated successfully, but these errors were encountered: