zoukankan      html  css  js  c++  java
  • 记录XPO查询 日志

    记录由XPO产生和执行的sql语句

    //z 2013-02-27 14:01:30 IS2120@BG57IV3.T2355831976.K[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]

    <?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>

    //z 2013-02-27 14:01:30 IS2120@BG57IV3.T2355831976.K[T215,L2906,R88,V3140]

    3. 使用 System.Diagnostics trace logging 机制

    [C#]

    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
    //z 2013-02-27 14:01:30 IS2120@BG57IV3.T2355831976.K[T215,L2906,R88,V3140]
  • 相关阅读:
    报表开发之扩展GROUP BY
    Leetcode--easy系列9
    datatable 前台和后台数据格式
    C实现头插法和尾插法来构建单链表(带头结点)
    HDOJ 题目1520 Anniversary party(树形dp)
    windows环境利用apache 配置虚拟主机
    POJ--1966--Cable TV Network【无向图顶点连通度】
    Linux Shell脚本编程学习笔记和实战
    win10 bcdedit加入vhdx启动
    设计模式之Mediator模式(笔记)
  • 原文地址:https://www.cnblogs.com/IS2120/p/6745993.html
Copyright © 2011-2022 走看看