我想在网站上使用下面的代码。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();
}
}