我正在使用应用程序见解和 nlog 配置 .net core 3 控制台应用程序
我的代码配置如下
程序.cs
.ConfigureLogging((hostingContext, logging) =>
{
logging.ClearProviders();
logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
logging.AddNLog(NLog.LogManager.LoadConfiguration("nlog.config").Configuration);
})
.ConfigureServices((hostContext, services) =>
{
services.SetupConfiguration(hostContext.Configuration);
services.AddApplicationInsightsTelemetryWorkerService("--AI-Key--");
Run Code Online (Sandbox Code Playgroud)
在我的 nlog.config 中我有
<extensions>
<add assembly="NLog.Web.AspNetCore"/>
<add assembly="Microsoft.ApplicationInsights.NLogTarget" />
</extensions>
<!-- the targets to write to -->
<targets>
<target name="Console" xsi:type="Console" layout="${longdate} ${level} ${message}"/>
<target xsi:type="ApplicationInsightsTarget" name="appInsights" />
</targets>
<!-- rules to map from logger name to target -->
<rules>
<!--All logs, including from Microsoft-->
<logger name="*" minlevel="Trace" writeTo="Console" />
<logger name="*" minlevel="Trace" writeTo="appInsights" />
</rules>
Run Code Online (Sandbox Code Playgroud)
在 …
有谁知道当你PUT一个对象时minio etag是如何生成的?它是文件的哈希值吗?我们可以用它来防止同一文件上传两次吗?
非常感谢!