【发布时间】:2017-08-25 20:21:27
【问题描述】:
我想在要部署到 Azure 的 ASP.NET Core 项目中实现 NLog。
我正在使用https://github.com/damienbod/AspNetCoreNlog中建议的代码
如何修改以下行以允许在 Azure 中使用?
在 nlog.config 中:
internalLogFile="C:\git\damienbod\AspNetCoreNlog\Logs\internal-nlog.txt"
在 Startup 类中:
LogManager.Configuration.Variables["configDir"] = "C:\\git\\damienbod\\AspNetCoreNlog\\Logs";
【问题讨论】:
-
我发现这个看起来可能就是你要找的东西damienbod.com/2016/08/17/…
-
该页面也没有说明如何修改对“C:\git\...”的所有引用,以便它可以在 Azure 中工作。
-
你可以在 azure 中写入文件吗?
-
是的,在这里回答。 stackoverflow.com/questions/12964129/… 我想我可以使用 Server.MapPath 来更改 Startup 类。如何在配置文件中做到这一点?
-
找到了答案。 intellitect.com/…
标签: asp.net-core azure-web-app-service nlog