const string Template = "Timestamp: {timestamp}{newline}" +
"Message: {message}{newline}" +
"Category: {category}{newline}" +
"Machine: {machine}{newline}";
TextFormatter formatter = new TextFormatter(Template);
const string LogFilePath = @"d:\\share\\messages.log";
FlatFileTraceListener logFileListener =
new FlatFileTraceListener(LogFilePath,
"----------",
"----------",
formatter);
LogSource mainLogSource = new LogSource("MainLogSource", SourceLevels.All);
![]()
mainLogSource.Listeners.Add(logFileListener);
| 第1页:
第1页}  ... |
第2页: 第2页 |