記錄由XPO産生和執行的sql語句
//z 2013-02-27 14:01:30 [email protected][T215,L2906,R88,V3140]
1. 在App.Config中添加如下行:
[XML]
<?xml
version="1.0"encoding="utf-8"?>
<configuration>
<system.diagnostics>
<switches>
<addname="XPO"value="3"/>
</switches>
</system.diagnostics>
</configuration>
2. 如果想記錄到一個檔案
在應用程式的配置檔案中加入:
<?xml
version="1.0"encoding="utf-8"?>
<configuration>
<system.diagnostics>
<traceautoflush="true"indentsize="4">
<listeners>
<addname="LogFileTraceListener"type="System.Diagnostics.TextWriterTraceListener"
initializeData="trace.log"/>
<removename="Default"/>
</listeners>
</trace>
<switches>
<addname="XPO"value="3"/>
</switches>
</system.diagnostics>
</configuration>
3. 使用 System.Diagnostics trace logging 機制
System.Diagnostics.Trace.Listeners.Add(newMyTraceListner(textBox1));
...
class MyTraceListner:System.Diagnostics.TraceListener{
TextBox outputWindow;
public MyTraceListner(TextBoxoutputWindow){
this.outputWindow=outputWindow;
}
public overridevoidWrite(stringmessage){
outputWindow.AppendText(message);
}
public overridevoidWriteLine(stringmessage){
outputWindow.AppendText(message+"\r\n");
}
}
記錄 日志 跟蹤 trace sql log debug xpo DevExpress
@IS2120#CNBLOGS.T2169364049[T1,L65,R1,V259]:備忘
$ € ₤ ₭ ₪ ₩ ₮ ₦ ₱ ฿ ₡ ₫ ﷼ ¥ ﷼ ₫ ₡ ฿ ₱ ₦ ₮ ₩ ₪ ₭ ₤ € $