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]
  • 相关阅读:
    java8 流操作
    MySQL重置密码
    利用工厂模式+策略模式去掉if-else
    windows10下按照mysql主从复制
    事务隔离级别
    事务传播行为
    Using hints for Postgresql
    PostgreSQL SQL HINT的使用说明
    源码升级SUSE openssh
    mysql之my.cnf详解
  • 原文地址:https://www.cnblogs.com/IS2120/p/6745993.html
Copyright © 2011-2022 走看看