Missing logging output after application deployment with Microsoft LoggerFactory
var loggerFactory = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config");
var dataPath = Environment.GetEnvironmentVariable("DATAPATH");
Console.WriteLine(@dataPath);
if (!string.IsNullOrEmpty(dataPath))
{
Console.WriteLine(@dataPath);
NLog.GlobalDiagnosticsContext.Set("aaa",@dataPath);
}
Hi! Thanks for opening your first issue here! Please make sure to follow the issue template - so we could help you better!
I cannot guess what you are trying to do based on that amount of input.
See also: https://github.com/NLog/NLog/wiki/Logging-troubleshooting
Please add the requested info, so we could help you better! (This issue will be closed in 7 days)
1 .use the command dotnet run -c release ,the gdc item configuration works,
2. use the command `dotnet build -c release ', then run the build output file, the gdc config item not works, the log file wasnot created


Try enabling https://github.com/NLog/NLog/wiki/Internal-logging (using internalLogLevel="Debug"), and compare the output from when it works and when it doesn't work.
Maybe the nlog.config cannot be loaded, maybe because the file is missing (Action = Copy if newer)
Try enabling https://github.com/NLog/NLog/wiki/Internal-logging (using
internalLogLevel="Debug"), and compare the output from when it works and when it doesn't work.Maybe the nlog.config cannot be loaded, maybe because the file is missing (Action =
Copy if newer)

Both looks great. I'm guessing your problem is that LogLevel-filtering has changed between the two scenarios:
Check appsettings.json and also any environment-specific like appsettings.development.json. See also: https://github.com/NLog/NLog.Web/wiki/Missing-trace%5Cdebug-logs-in-ASP.NET-Core-6%3F
Notice NLog 5.0 will change so RemoveLoggerFactoryFilter = true becomes enabled by default, but you can already now explicitly enable it in UseNLog().