我想在网站上使用下面的代码。 我应该添加哪些config sections
到web.config
文件中,以便将输出记录到文件或Windows事件日志中?
using System.Diagnostics;
// Singleton in real code
Class Logger
{
// In constructor: Trace.AutoFlush = false;
public void Log(message)
{
String formattedLog = formatLog(message);
Trace.TraceInformation(formattedLog);
Trace.Flush();
}
}