gbase 8a dblink日志级别设置

1.下载并解压网关安装包,并配置好dblink

2.Dblink日志级别默认是”INFO”,记录内容如下:

2023-07-27 14:11:46,353 INFO [main] server.GBaseGateway main (GBaseGateway.java:35) - GBaseGateway init start, log4j init ok!

2023-07-27 14:11:46,363 INFO [main] server.GBaseGateway main (GBaseGateway.java:39) - GBaseGateway load plugin ok!

2023-07-27 14:11:52,076 INFO [pool-2-thread-1] common.JSONUtil json2CommandInfo (JSONUtil.java:54) - 获取到的long_protocol_flag为:true

2023-07-27 14:11:52,140 INFO [pool-2-thread-1] logic.GatewayLogic execute (GatewayLogic.java:81) - read datasource file:2023-07-27 14:11:52:dblink_link4.properties

3.日志内容较少,可通过修改conf目录下的log4j.xml文件,将日志级别改为”DEBUG”,

该文件原内容如下:

[gbase@makaixuan-node-3 conf]$ pwd

/home/gbase/Gateway_8.5.1.2_build4.19.1/conf

[gbase@makaixuan-node-3 conf]$ cat log4j.xml

<?xml version="1.0" encoding="UTF-8"?>

<configuration status="INFO">

    <appenders>

        <console name="Console" target="SYSTEM_OUT">

            <thresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY" />

            <patternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m\n" />

        </console>

        <rollingFile name="RollingFile" fileName="logs/gbaseGateway.log" filePattern="logs/gbaseGateway.log.%i">

            <thresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY" />

            <patternLayout pattern="%d %-5p [%t] %C{2} %M (%F:%L) - %m\n" />

            <sizeBasedTriggeringPolicy size="10MB" />

            <defaultRolloverStrategy max="10" />

        </rollingFile>

    </appenders>

 

    <loggers>

        <root level="INFO">

           <!-- <appenderRef ref="Console" /> -->

            <appenderRef ref="RollingFile" />

        </root>

    </loggers>

</configuration>

修改"INFO"为"DEBUG",修改如下:

[gbase@makaixuan-node-3 conf]$ pwd

/home/gbase/Gateway_8.5.1.2_build4.19.1/conf

[gbase@makaixuan-node-3 conf]$ cat log4j.xml

<?xml version="1.0" encoding="UTF-8"?>

<configuration status="DEBUG">

    <appenders>

        <console name="Console" target="SYSTEM_OUT">

            <thresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY" />

            <patternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m\n" />

        </console>

        <rollingFile name="RollingFile" fileName="logs/gbaseGateway.log" filePattern="logs/gbaseGateway.log.%i">

            <thresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY" />

            <patternLayout pattern="%d %-5p [%t] %C{2} %M (%F:%L) - %m\n" />

            <sizeBasedTriggeringPolicy size="10MB" />

            <defaultRolloverStrategy max="10" />

        </rollingFile>

    </appenders>

 

    <loggers>

        <root level="DEBUG">

           <!-- <appenderRef ref="Console" /> -->

            <appenderRef ref="RollingFile" />

        </root>

    </loggers>

</configuration>

4.修改完成后,重启网关服务

5.再次执行dblink查询时,日志记录内容较全面

2023-07-27 14:31:04,604 DEBUG [pool-2-thread-3] gatewayServer.SocketThreadForRequest run (SocketThreadForRequest.java:99) - Thread ID = 21-1690439464604: deal with one request start ,

2023-07-27 14:31:04,605 DEBUG [pool-2-thread-3] gatewayServer.SocketThreadForRequest run (SocketThreadForRequest.java:101) - into server thread: sessionid=null,requestIP=null,threadid=21-1690439464604,iskill=falseconnectionkilled=false

2023-07-27 14:31:04,606 DEBUG [pool-2-thread-3] common.SocketOption read (SocketOption.java:82) - Thread ID = 21: packetLength:162,

2023-07-27 14:31:04,607 DEBUG [pool-2-thread-3] common.SocketOption read (SocketOption.java:94) - Thread ID = 21: read from socket info:{“COMMAND_TYPE”:“getmetadata”,“DS_Name”:“dblink_link4”,“SC_User”:“”,“SC_Pwd”:“”,“SC_TableName”:“T1”,“SC_FieldName”:“*”,“long_protocol_flag”:“1”,“MigrateType”:“0”},

2023-07-27 14:31:04,607 DEBUG [pool-2-thread-3] gatewayServer.SocketThreadForRequest printCommandInfoDebugLog (SocketThreadForRequest.java:342) - Thread ID = 21-1690439464604: 10.10.14.199: request commandInfo ={“COMMAND_TYPE”:“getmetadata”,“DS_Name”:“dblink_link4”,“SC_User”:“”,“SC_Pwd”:“”,“SC_TableName”:“T1”,“SC_FieldName”:“*”,“long_protocol_flag”:“1”,“MigrateType”:“0”},

2023-07-27 14:31:04,608 DEBUG [pool-2-thread-3] common.JSONUtil json2CommandInfo (JSONUtil.java:42) - Thread ID = 21: 转换json->CommandInfo开始,json:{“COMMAND_TYPE”:“getmetadata”,“DS_Name”:“dblink_link4”,“SC_User”:“”,“SC_Pwd”:“”,“SC_TableName”:“T1”,“SC_FieldName”:“*”,“long_protocol_flag”:“1”,“MigrateType”:“0”},

2023-07-27 14:31:04,608 INFO [pool-2-thread-3] common.JSONUtil json2CommandInfo (JSONUtil.java:54) - 获取到的long_protocol_flag为:true

2023-07-27 14:31:04,608 DEBUG [pool-2-thread-3] common.JSONUtil json2CommandInfo (JSONUtil.java:243) - Thread ID = 21: 转换json->CommandInfo结束,CommandInfo:CommandInfo [COMMAND_TYPE=getmetadata, MigrateType=null, DS_Name=dblink_link4, SC_User=, SC_Pwd=, SC_TableName=T1, from_one_ds=null, DC_DBIP=null, DC_DBGlusterPort=null, DC_DBGnodePort=null, DC_DBName=null, SQL_Statement=null, Target_Table=null, Target_Columns=null, Select_Statement=null, SRC_USE_DB=null, is_select=null, is_host=null, is_port=null, is_user=null, is_password=null, is_database=null, is_table=null, is_comment=null, select=null, table_name=null, GC_SESSION_ID=null, requestIP=null, long_protocol_flag=true, SC_FieldName=*, DC_SCN=null, DC_TYPE=null, into_server_flag=true],

2023-07-27 14:31:04,609 DEBUG [pool-2-thread-3] gatewayProperties.DatabaseProperties initDataBaseInfo (DatabaseProperties.java:36) - Thread ID = 21: 读取数据库配置文件开始:./conf/dataSource/dblink_link4.properties,

2023-07-27 14:31:04,611 DEBUG [pool-2-thread-3] gatewayProperties.DatabaseProperties initDataBaseInfo (DatabaseProperties.java:74) - Thread ID = 21: 读取数据库配置文件结束:./conf/dataSource/dblink_link4.properties,

2023-07-27 14:31:04,611 DEBUG [pool-2-thread-3] gatewayServer.SocketThreadForRequest run (SocketThreadForRequest.java:180) - Thread ID = 21-1690439464604: dataSources:[DataBaseInfo [name=ds1, ip=10.10.12.211, port=5258, user=root, pwd=, dbtype=gcluster, dbname=mkx, encode=null, charset=null, url=null]],

2023-07-27 14:31:04,611 DEBUG [pool-2-thread-3] gatewayServer.SocketThreadForRequest run (SocketThreadForRequest.java:194) - Thread ID = 21-1690439464604: before gatewayLogic.excute ,

2023-07-27 14:31:04,612 DEBUG [pool-2-thread-3] logic.GatewayLogic execute (GatewayLogic.java:65) - Thread ID = 21: ----执行透明网关具体业务开始----,

2023-07-27 14:31:04,612 INFO [pool-2-thread-3] logic.GatewayLogic execute (GatewayLogic.java:81) - read datasource file:2023-07-27 14:31:04:dblink_link4.properties

2023-07-27 14:31:04,612 DEBUG [pool-2-thread-3] logic.GatewayLogic execute (GatewayLogic.java:97) - Thread ID = 21: 开始获取源数据集群的数据连接,DataSourceName为:ds1,

2023-07-27 14:31:04,641 DEBUG [pool-2-thread-3] logic.GatewayLogic execute (GatewayLogic.java:113) - Thread ID = 21: 获取源数据集群的数据连接,DataSourceName为:ds1 的数据源获取成功,

2023-07-27 14:31:04,641 DEBUG [pool-2-thread-3] logic.GatewayLogic execute (GatewayLogic.java:142) - Thread ID = 21: 表结构迁移开始,src:com.gbase.jdbc.JDBC4Connection@420b1d57 table:T1,

2023-07-27 14:31:04,645 DEBUG [pool-2-thread-3] logic.GatewayLogic execute (GatewayLogic.java:231) - Thread ID = 21: 表结构迁移成功,src:com.gbase.jdbc.JDBC4Connection@420b1d57 table:T1,

2023-07-27 14:31:04,647 DEBUG [pool-2-thread-3] gatewayServer.SocketThreadForRequest run (SocketThreadForRequest.java:215) - Thread ID = 21-1690439464604: after gatewayLogic.excute ,

2023-07-27 14:31:04,647 DEBUG [pool-2-thread-3] gatewayServer.SocketThreadForRequest run (SocketThreadForRequest.java:223) - Thread ID = 21-1690439464604: return message to 8a :CommandReturnInfo [TE_Status=0, TE_Info=null, TE_affect_rows=null, tableStruct=(

a int(11) ,b int(11) ) ENGINE=EXPRESS , isReplicatedTable=0, TE_Find=0, dataSources=[DataBaseInfo [name=ds1, ip=10.10.12.211, port=5258, user=root, pwd=, dbtype=gcluster, dbname=mkx, encode=null, charset=null, url=null]]],

2023-07-27 14:31:04,648 DEBUG [pool-2-thread-3] common.JSONUtil metadataCommandReturn2Json (JSONUtil.java:314) - Thread ID = 21: 转换CommandReturnInfo->json开始,CommandReturnInfo:CommandReturnInfo [TE_Status=0, TE_Info=null, TE_affect_rows=null, tableStruct=(

a int(11) ,b int(11) ) ENGINE=EXPRESS , isReplicatedTable=0, TE_Find=0, dataSources=[DataBaseInfo [name=ds1, ip=10.10.12.211, port=5258, user=root, pwd=, dbtype=gcluster, dbname=mkx, encode=null, charset=null, url=null]]],

2023-07-27 14:31:04,648 DEBUG [pool-2-thread-3] common.JSONUtil metadataCommandReturn2Json (JSONUtil.java:351) - Thread ID = 21: 转换CommandReturnInfo->json结束,json:{“TE_Status”:“0”,“tableStruct”:"(

a int(11) ,b int(11) ) ENGINE=EXPRESS “,“isReplicatedTable”:“0”,“dataSources”:[{“name”:“ds1”,“ip”:“10.10.12.211”,“port”:“5258”,“dbname”:“mkx”,“dbtype”:“gcluster”,“user”:“root”,“pwd”:”"}]},

2023-07-27 14:31:04,648 DEBUG [pool-2-thread-3] gatewayServer.SocketThreadForRequest run (SocketThreadForRequest.java:241) - Thread ID = 21-1690439464604: returnmsg={“TE_Status”:“0”,“tableStruct”:"(

a int(11) ,b int(11) ) ENGINE=EXPRESS “,“isReplicatedTable”:“0”,“dataSources”:[{“name”:“ds1”,“ip”:“10.10.12.211”,“port”:“5258”,“dbname”:“mkx”,“dbtype”:“gcluster”,“user”:“root”,“pwd”:”"}]},

2023-07-27 14:31:04,649 DEBUG [pool-2-thread-3] gatewayServer.SocketThreadForRequest run (SocketThreadForRequest.java:243) - Thread ID = 21-1690439464604: wait for gcluster’s return finish info message=CommandReturnInfo [TE_Status=0, TE_Info=null, TE_affect_rows=null, tableStruct=(

a int(11) ,b int(11) ) ENGINE=EXPRESS , isReplicatedTable=0, TE_Find=0, dataSources=[DataBaseInfo [name=ds1, ip=10.10.12.211, port=5258, user=root, pwd=, dbtype=gcluster, dbname=mkx, encode=null, charset=null, url=null]]],

2023-07-27 14:31:04,669 DEBUG [pool-2-thread-3] common.SocketOption read (SocketOption.java:82) - Thread ID = 21: packetLength:17,

2023-07-27 14:31:04,669 DEBUG [pool-2-thread-3] common.SocketOption read (SocketOption.java:94) - Thread ID = 21: read from socket info:{‘TE_Status’:‘0’},

2023-07-27 14:31:04,669 DEBUG [pool-2-thread-3] common.JSONUtil json2FinishInfo (JSONUtil.java:363) - Thread ID = 21: 转换json->FinishInfo开始,json:{‘TE_Status’:‘0’},

2023-07-27 14:31:04,670 DEBUG [pool-2-thread-3] common.JSONUtil json2FinishInfo (JSONUtil.java:370) - Thread ID = 21: 转换json->FinishInfo结束,FinishInfo:FinishInfo [TE_Status=0],

2023-07-27 14:31:04,670 DEBUG [Thread-7] common.TimeoutThread run (SocketOption.java:506) - Thread ID = 21: socket read status: isReadOk= true is timeout: false use time:21,

2023-07-27 14:31:04,670 DEBUG [pool-2-thread-3] gatewayServer.SocketThreadForRequest run (SocketThreadForRequest.java:260) - Thread ID = 21-1690439464604: finishInfo: {‘TE_Status’:‘0’}commandReturnInfo=CommandReturnInfo [TE_Status=0, TE_Info=null, TE_affect_rows=null, tableStruct=(

a int(11) ,b int(11) ) ENGINE=EXPRESS , isReplicatedTable=0, TE_Find=0, dataSources=[DataBaseInfo [name=ds1, ip=10.10.12.211, port=5258, user=root, pwd=, dbtype=gcluster, dbname=mkx, encode=null, charset=null, url=null]]],

2023-07-27 14:31:04,670 DEBUG [pool-2-thread-3] logic.GatewayLogic close (GatewayLogic.java:1257) - Thread ID = 21: 关闭源和目标数据库开始,

2023-07-27 14:31:04,671 DEBUG [pool-2-thread-3] logic.GatewayLogic close (GatewayLogic.java:1269) - Thread ID = 21: 关闭源和目标数据库结束,

2023-07-27 14:31:04,671 DEBUG [pool-2-thread-3] gatewayServer.SocketThreadForRequest run (SocketThreadForRequest.java:328) - Thread ID = 21-1690439464604: deal with one request end,

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值