Skip to content

Commit

Permalink
Clean up the log codes and configuration. (sofastack#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
ujjboy authored Apr 17, 2018
1 parent c8df344 commit 69581ee
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 306 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
02303=RPC protocol ({0}), service [{1}], method [{2}]. Exception:\nParameters: [{3}]. Reason: timeout exception, please check the server log, cost [{4}]ms
02304=Cannot get socket connect of service [{0}]
02305=Cannot find the implementation of RPC invoke service: {0}
02306=Cannot get the service address of service [{0}], please check $HOME/logs/rpc/sofa-registry.log
02306=Cannot get the service address of service [{0}], please check the registry log.
02307=Parse property of transmit error, default value is empty
02308=Cannot get the transmit appName, publish transmit dataId failed
02309=Property of transmit timeout is wrong, default value: [{0}]ms
02310=Parse property of transmit url error
02311=Transmit error
02312=Cannot find the service address [{1}] of service [{0}]
02312=Cannot find the service address [{1}] of service [{0}]
02401=Current thread cannot get ResponseFuture, while using future invoke please be careful on switching classloader
02402=Cannot find class [{0}] while deserializing request
02403=Cannot find class [{0}] while deserializing response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
02303=基于({0})RPC协议调用服务[{1}]的[{2}]方法时出现错误:\n参数信息为:[{3}],错误原因为超时,请查看服务器端的执行日志是否也超时,执行时间为:{4}毫秒
02304=调用远程 Sofa RPC 服务时无法取得连接[{0}]
02305=没有可用的调用 Sofa RPC 服务的实现,所调用的方式为:TR 的{0}方式
02306=没有获得服务[{0}]的调用地址,请检查$HOME/logs/rpc/sofa-registry.log服务是否推送
02306=没有获得服务[{0}]的调用地址,请检查服务是否已经推送
02307=解析转发antx变量配置时出现异常,默认设定转发地址为空,将不会转发
02308=解析转发模式时获取不到appName,发布转发dataId失败
02309=tr转发超时antx配置解析有误,将使用默认值[{0}]ms
Expand All @@ -74,7 +74,7 @@
02416=Failed to write services file
02417=LocalFileRegistry failed to read services file
02418=Cannot get the service address of service [{0}], please check local Registry file[{1}]
02419=其他进程操作本地注册文件超时,请检查文件是否异常,删除临时文件[{0}]重新启动进程!
02419=其他进程操作本地注册文件超时,请检查文件是否异常,删除临时文件[{0}]重新启动进程!
02420=获取不到服务[{0}]对应网络链接,请确保对方的服务成功发布,并且本地注册文件对应地址正确!
02421=Future线程上下文没清空,请使用:SofaResponseFuture.getResponse(timeout, true);
02422=丢弃客户端已经超时的请求,不再处理请求,接口:[{0}], 来自:[{1}]
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
</layout>
</appender>

<appender name="TR-SERIALIZE-APPENDER" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="${logging.path}/rpc/${appname}/taobao-remoting-serialization.log"/>
<appender name="RPC-CODEC-APPENDER" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="${logging.path}/rpc/${appname}/rpc-codec.log"/>
<param name="append" value="true"/>
<param name="encoding" value="${file.encoding}"/>
<param name="threshold" value="${logging.level.com.alipay.sofa.rpc}"/>
Expand All @@ -33,8 +33,8 @@
</layout>
</appender>

<appender name="REGISTRY-APPENDER" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="${logging.path}/rpc/${appname}/sofa-registry.log"/>
<appender name="RPC-REGISTRY-APPENDER" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="${logging.path}/rpc/${appname}/rpc-registry.log"/>
<param name="append" value="true"/>
<param name="encoding" value="${file.encoding}"/>
<param name="threshold" value="${logging.level.com.alipay.sofa.rpc}"/>
Expand All @@ -43,8 +43,8 @@
</layout>
</appender>

<appender name="SOFA-ROUTER-APPENDER" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="${logging.path}/rpc/${appname}/sofa-router.log"/>
<appender name="RPC-CLIENT-APPENDER" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="${logging.path}/rpc/${appname}/rpc-client.log"/>
<param name="append" value="true"/>
<param name="encoding" value="${file.encoding}"/>
<param name="threshold" value="${logging.level.com.alipay.sofa.rpc}"/>
Expand All @@ -53,8 +53,8 @@
</layout>
</appender>

<appender name="SOFA-APPENDER" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="${logging.path}/rpc/${appname}/sofa-default.log"/>
<appender name="RPC-SERVER-APPENDER" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="${logging.path}/rpc/${appname}/rpc-server.log"/>
<param name="append" value="true"/>
<param name="encoding" value="${file.encoding}"/>
<param name="threshold" value="${logging.level.com.alipay.sofa.rpc}"/>
Expand All @@ -63,8 +63,8 @@
</layout>
</appender>

<appender name="TAOBAO-APPENDER" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="${logging.path}/rpc/${appname}/taobao-default.log"/>
<appender name="RPC-TRANSPORT-APPENDER" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="${logging.path}/rpc/${appname}/rpc-transport.log"/>
<param name="append" value="true"/>
<param name="encoding" value="${file.encoding}"/>
<param name="threshold" value="${logging.level.com.alipay.sofa.rpc}"/>
Expand All @@ -73,82 +73,33 @@
</layout>
</appender>

<appender name="TR-CONNECTION-DIGEST-APPENDER" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="${logging.path}/rpc/${appname}/tr-connection-digest.log"/>
<param name="append" value="true"/>
<param name="encoding" value="${file.encoding}"/>
<param name="threshold" value="${logging.level.com.alipay.sofa.rpc}"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p %-32t - %m%n"/>
</layout>
</appender>

<appender name="TR-LOG-FILE" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="${logging.path}/rpc/${appname}/taobao-remoting.log"/>
<param name="append" value="true"/>
<param name="encoding" value="${file.encoding}"/>
<param name="threshold" value="${logging.level.com.alipay.sofa.rpc}"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%n%d %-5p %c{2} - %n%m%n"/>
</layout>
</appender>

<appender name="REMOTING-LOG-FILE" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="${logging.path}/rpc/${appname}/sofa-remoting.log"/>
<param name="append" value="true"/>
<param name="encoding" value="${file.encoding}"/>
<param name="threshold" value="${logging.level.com.alipay.sofa.rpc}"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p %-32t %c{2} - %m%n"/>
</layout>
</appender>

<logger name="TR-CONNECTION-POOL-DIGEST" additivity="false">
<logger name="com.alipay.sofa.rpc.registry" additivity="false">
<level value="${logging.level.com.alipay.sofa.rpc}"/>
<appender-ref ref="TR-CONNECTION-DIGEST-APPENDER"/>
<appender-ref ref="RPC-REGISTRY-APPENDER"/>
<appender-ref ref="ERROR-APPENDER"/>
</logger>

<logger name="RPC-REGISTRY" additivity="false">
<level value="${logging.level.com.alipay.sofa.rpc}"/>
<appender-ref ref="REGISTRY-APPENDER"/>
<appender-ref ref="ERROR-APPENDER"/>
</logger>


<logger name="SOFA-ROUTER" additivity="false">
<logger name="com.alipay.sofa.rpc.client" additivity="false">
<level value="${logging.level.com.alipay.sofa.rpc}"/>
<appender-ref ref="SOFA-ROUTER-APPENDER"/>
<appender-ref ref="RPC-CLIENT-APPENDER"/>
<appender-ref ref="ERROR-APPENDER"/>
</logger>

<logger name="com.alipay.sofa.rpc.codec" additivity="false">
<level value="${logging.level.com.alipay.sofa.rpc}"/>
<appender-ref ref="TR-SERIALIZE-APPENDER"/>
<appender-ref ref="RPC-CODEC-APPENDER"/>
<appender-ref ref="ERROR-APPENDER"/>
</logger>

<logger name="com.taobao.remoting" additivity="false">
<level value="${logging.level.com.alipay.sofa.rpc}"/>
<appender-ref ref="TR-LOG-FILE"/>
<appender-ref ref="ERROR-APPENDER"/>
</logger>

<logger name="com.alipay.remoting" additivity="false">
<level value="${logging.level.com.alipay.sofa.rpc}"/>
<appender-ref ref="REMOTING-LOG-FILE"/>
<appender-ref ref="ERROR-APPENDER"/>
</logger>
</logger>`

<logger name="com.alipay.sofa" additivity="false">
<logger name="com.alipay.sofa.rpc.server" additivity="false">
<level value="${logging.level.com.alipay.sofa.rpc}"/>
<appender-ref ref="SOFA-APPENDER"/>
<appender-ref ref="RPC-SERVER-APPENDER"/>
<appender-ref ref="ERROR-APPENDER"/>
</logger>

<logger name="com.taobao" additivity="false">
<logger name="com.alipay.sofa.rpc.transport" additivity="false">
<level value="${logging.level.com.alipay.sofa.rpc}"/>
<appender-ref ref="TAOBAO-APPENDER"/>
<appender-ref ref="RPC-TRANSPORT-APPENDER"/>
<appender-ref ref="ERROR-APPENDER"/>
</logger>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@
</Policies>
</RollingFile>

<RollingFile name="TR-SERIALIZE-APPENDER" fileName="${RPC_LOG_PATH}/rpc/${APP_NAME}/taobao-remoting-serialization.log"
append="true"
filePattern="${RPC_LOG_PATH}/rpc/${APP_NAME}/taobao-remoting-serialization.log.%d{yyyy-MM-dd}">
<RollingFile name="RPC-CODEC-APPENDER" fileName="${RPC_LOG_PATH}/rpc/${APP_NAME}/rpc-codec.log" append="true"
filePattern="${RPC_LOG_PATH}/rpc/${APP_NAME}/rpc-codec.log.%d{yyyy-MM-dd}">
<ThresholdFilter level="${RPC_LOG_LEVEL}" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout charset="${RPC_FILE_ENCODING}">
<pattern>%d %-5p %-32t - %m%n</pattern>
Expand All @@ -49,8 +48,8 @@
</Policies>
</RollingFile>

<RollingFile name="REGISTRY-APPENDER" fileName="${RPC_LOG_PATH}/rpc/${APP_NAME}/sofa-registry.log" append="true"
filePattern="${RPC_LOG_PATH}/rpc/${APP_NAME}/sofa-registry.log.%d{yyyy-MM-dd}">
<RollingFile name="RPC-REGISTRY-APPENDER" fileName="${RPC_LOG_PATH}/rpc/${APP_NAME}/rpc-registry.log" append="true"
filePattern="${RPC_LOG_PATH}/rpc/${APP_NAME}/rpc-registry.log.%d{yyyy-MM-dd}">
<ThresholdFilter level="${RPC_LOG_LEVEL}" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout charset="${RPC_FILE_ENCODING}">
<pattern>%d %-5p %-32t %c - %m%n</pattern>
Expand All @@ -61,8 +60,8 @@
</Policies>
</RollingFile>

<RollingFile name="SOFA-ROUTER-APPENDER" fileName="${RPC_LOG_PATH}/rpc/${APP_NAME}/sofa-router.log" append="true"
filePattern="${RPC_LOG_PATH}/rpc/${APP_NAME}/sofa-router.log.%d{yyyy-MM-dd}">
<RollingFile name="RPC-CLIENT-APPENDER" fileName="${RPC_LOG_PATH}/rpc/${APP_NAME}/rpc-client.log" append="true"
filePattern="${RPC_LOG_PATH}/rpc/${APP_NAME}/rpc-client.log.%d{yyyy-MM-dd}">
<ThresholdFilter level="${RPC_LOG_LEVEL}" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout charset="${RPC_FILE_ENCODING}">
<pattern>%d %-5p %-32t %c - %m%n</pattern>
Expand All @@ -73,8 +72,8 @@
</Policies>
</RollingFile>

<RollingFile name="SOFA-APPENDER" fileName="${RPC_LOG_PATH}/rpc/${APP_NAME}/sofa-default.log" append="true"
filePattern="${RPC_LOG_PATH}/rpc/${APP_NAME}/sofa-default.log.%d{yyyy-MM-dd}">
<RollingFile name="RPC-SERVER-APPENDER" fileName="${RPC_LOG_PATH}/rpc/${APP_NAME}/rpc-server.log" append="true"
filePattern="${RPC_LOG_PATH}/rpc/${APP_NAME}/rpc-server.log.%d{yyyy-MM-dd}">
<ThresholdFilter level="${RPC_LOG_LEVEL}" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout charset="${RPC_FILE_ENCODING}">
<pattern>%d %-5p %-32t %c - %m%n</pattern>
Expand All @@ -85,8 +84,8 @@
</Policies>
</RollingFile>

<RollingFile name="TAOBAO-APPENDER" fileName="${RPC_LOG_PATH}/rpc/${APP_NAME}/taobao-default.log" append="true"
filePattern="${RPC_LOG_PATH}/rpc/${APP_NAME}/taobao-default.log.%d{yyyy-MM-dd}">
<RollingFile name="RPC-TRANSPORT-APPENDER" fileName="${RPC_LOG_PATH}/rpc/${APP_NAME}/rpc-transport.log" append="true"
filePattern="${RPC_LOG_PATH}/rpc/${APP_NAME}/rpc-transport.log.%d{yyyy-MM-dd}">
<ThresholdFilter level="${RPC_LOG_LEVEL}" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout charset="${RPC_FILE_ENCODING}">
<pattern>%d %-5p %-32t %c - %m%n</pattern>
Expand All @@ -97,83 +96,31 @@
</Policies>
</RollingFile>

<RollingFile name="TR-CONNECTION-DIGEST-APPENDER" fileName="${RPC_LOG_PATH}/rpc/${APP_NAME}/tr-connection-digest.log"
append="true"
filePattern="${RPC_LOG_PATH}/rpc/${APP_NAME}/tr-connection-digest.log.%d{yyyy-MM-dd}">
<ThresholdFilter level="${RPC_LOG_LEVEL}" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout charset="${RPC_FILE_ENCODING}">
<pattern>%d %-5p %-32t - %m%n</pattern>
</PatternLayout>
<Policies>
<!-- 按天分日志文件:重要的是 filePattern 配置到按照天 -->
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
</RollingFile>

<RollingFile name="TR-LOG-FILE" fileName="${RPC_LOG_PATH}/rpc/${APP_NAME}/taobao-remoting.log" append="true"
filePattern="${RPC_LOG_PATH}/rpc/${APP_NAME}/taobao-remoting.log.%d{yyyy-MM-dd}">
<ThresholdFilter level="${RPC_LOG_LEVEL}" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout charset="${RPC_FILE_ENCODING}">
<pattern>%n%d %-5p %c{2} - %n%m%n</pattern>
</PatternLayout>
<Policies>
<!-- 按天分日志文件:重要的是 filePattern 配置到按照天 -->
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
</RollingFile>

<RollingFile name="REMOTING-LOG-FILE" fileName="${RPC_LOG_PATH}/rpc/${APP_NAME}/sofa-remoting.log" append="true"
filePattern="${RPC_LOG_PATH}/rpc/${APP_NAME}/sofa-remoting.log.%d{yyyy-MM-dd}">
<ThresholdFilter level="${RPC_LOG_LEVEL}" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout charset="${RPC_FILE_ENCODING}">
<pattern>%d %-5p %-32t %c{2} - %m%n</pattern>
</PatternLayout>
<Policies>
<!-- 按天分日志文件:重要的是 filePattern 配置到按照天 -->
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
</RollingFile>
</appenders>

<loggers>
<logger name="TR-CONNECTION-POOL-DIGEST" level="${RPC_LOG_LEVEL}" additivity="false">
<appender-ref ref="TR-CONNECTION-DIGEST-APPENDER"/>
<appender-ref ref="ERROR-APPENDER"/>
</logger>

<logger name="RPC-REGISTRY" level="${RPC_LOG_LEVEL}" additivity="false">
<appender-ref ref="REGISTRY-APPENDER"/>
<appender-ref ref="ERROR-APPENDER"/>
</logger>


<logger name="SOFA-ROUTER" level="${RPC_LOG_LEVEL}" additivity="false">
<appender-ref ref="SOFA-ROUTER-APPENDER"/>
<logger name="com.alipay.sofa.rpc.registry" level="${RPC_LOG_LEVEL}" additivity="false">
<appender-ref ref="RPC-REGISTRY-APPENDER"/>
<appender-ref ref="ERROR-APPENDER"/>
</logger>

<logger name="com.alipay.sofa.rpc.codec" level="${RPC_LOG_LEVEL}" additivity="false">
<appender-ref ref="TR-SERIALIZE-APPENDER"/>
<appender-ref ref="ERROR-APPENDER"/>
</logger>

<logger name="com.taobao.remoting" level="${RPC_LOG_LEVEL}" additivity="false">
<appender-ref ref="TR-LOG-FILE"/>
<appender-ref ref="RPC-CODEC-APPENDER"/>
<appender-ref ref="ERROR-APPENDER"/>
</logger>

<logger name="com.alipay.remoting" level="${RPC_LOG_LEVEL}" additivity="false">
<appender-ref ref="REMOTING-LOG-FILE"/>
<logger name="com.alipay.sofa.rpc.client" level="${RPC_LOG_LEVEL}" additivity="false">
<appender-ref ref="RPC-CLIENT-APPENDER"/>
<appender-ref ref="ERROR-APPENDER"/>
</logger>

<logger name="com.alipay.sofa" level="${RPC_LOG_LEVEL}" additivity="false">
<appender-ref ref="SOFA-APPENDER"/>
<logger name="com.alipay.sofa.rpc.server" level="${RPC_LOG_LEVEL}" additivity="false">
<appender-ref ref="RPC-SERVER-APPENDER"/>
<appender-ref ref="ERROR-APPENDER"/>
</logger>

<logger name="com.taobao" level="${RPC_LOG_LEVEL}" additivity="false">
<appender-ref ref="TAOBAO-APPENDER"/>
<logger name="com.alipay.sofa.rpc.transport" level="${RPC_LOG_LEVEL}" additivity="false">
<appender-ref ref="RPC-TRANSPORT-APPENDER"/>
<appender-ref ref="ERROR-APPENDER"/>
</logger>

Expand Down
Loading

0 comments on commit 69581ee

Please sign in to comment.