Commit 8b875c4a authored by AlexStocks's avatar AlexStocks

Mod: run client/server

parent d861f584
......@@ -49,9 +49,13 @@ func initConf() {
return
}
conf = new(rpc.ClientConfig)
conf = &microConfig{}
config.MustLoadWithPath(confFile, conf)
if err := conf.CheckValidity(); err != nil {
if err := conf.ClientConfig.CheckValidity(); err != nil {
panic(jerrors.ErrorStack(err))
return
}
if err := conf.Registry.CheckValidity(); err != nil {
panic(jerrors.ErrorStack(err))
return
}
......
......@@ -19,7 +19,8 @@ import (
)
import (
"github.com/AlexStocks/getty-examples/rpc/proto"
"github.com/AlexStocks/getty-examples/micro/proto"
"github.com/AlexStocks/getty/micro"
"github.com/AlexStocks/getty/rpc"
"github.com/AlexStocks/goext/net"
log "github.com/AlexStocks/log4go"
......@@ -31,7 +32,7 @@ const (
)
var (
client *rpc.Client
client *micro.Client
)
////////////////////////////////////////////////////////////////////
......@@ -44,7 +45,6 @@ func main() {
initProfiling()
initClient()
// gxlog.CInfo("%s starts successfull! its version=%s\n", conf.AppName, Version)
log.Info("%s starts successfull! its version=%s\n", conf.AppName, Version)
go test()
......@@ -66,7 +66,7 @@ func initProfiling() {
func initClient() {
var err error
client, err = rpc.NewClient(conf)
client, err = micro.NewClient(&conf.ClientConfig, &conf.Registry)
if err != nil {
panic(jerrors.ErrorStack(err))
}
......@@ -108,28 +108,28 @@ func initSignal() {
}
func testJSON() {
ts := rpc_examples.TestService{}
testReq := rpc_examples.TestReq{"aaa", "bbb", "ccc"}
testRsp := rpc_examples.TestRsp{}
err := client.Call(rpc.CodecJson, "127.0.0.1:20000", ts.Service(), "Test", &testReq, &testRsp)
ts := micro_examples.TestService{}
testReq := micro_examples.TestReq{"aaa", "bbb", "ccc"}
testRsp := micro_examples.TestRsp{}
err := client.Call(nil, rpc.CodecJson, ts.Service(), ts.Version(), "Test", &testReq, &testRsp)
if err != nil {
log.Error("client.Call(Json, TestService::Test) = error:%s", jerrors.ErrorStack(err))
return
}
log.Info("TestService::Test(Json, param:%#v) = res:%s", testReq, testRsp)
addReq := rpc_examples.AddReq{1, 10}
addRsp := rpc_examples.AddRsp{}
err = client.Call(rpc.CodecJson, "127.0.0.1:10000", ts.Service(), "Add", &addReq, &addRsp)
addReq := micro_examples.AddReq{1, 10}
addRsp := micro_examples.AddRsp{}
err = client.Call(nil, rpc.CodecJson, ts.Service(), ts.Version(), "Add", &addReq, &addRsp)
if err != nil {
log.Error("client.Call(Json, TestService::Add) = error:%s", jerrors.ErrorStack(err))
return
}
log.Info("TestService::Add(Json, req:%#v) = res:%#v", addReq, addRsp)
errReq := rpc_examples.ErrReq{1}
errRsp := rpc_examples.ErrRsp{}
err = client.Call(rpc.CodecJson, "127.0.0.1:20000", ts.Service(), "Err", &errReq, &errRsp)
errReq := micro_examples.ErrReq{1}
errRsp := micro_examples.ErrRsp{}
err = client.Call(nil, rpc.CodecJson, ts.Service(), ts.Version(), "Err", &errReq, &errRsp)
if err != nil {
// error test case, this invocation should step into this branch.
log.Error("client.Call(Json, TestService::Err) = error:%s", jerrors.ErrorStack(err))
......@@ -139,28 +139,28 @@ func testJSON() {
}
func testProtobuf() {
ts := rpc_examples.TestService{}
testReq := rpc_examples.TestReq{"aaa", "bbb", "ccc"}
testRsp := rpc_examples.TestRsp{}
err := client.Call(rpc.CodecProtobuf, "127.0.0.1:20000", ts.Service(), "Test", &testReq, &testRsp)
ts := micro_examples.TestService{}
testReq := micro_examples.TestReq{"aaa", "bbb", "ccc"}
testRsp := micro_examples.TestRsp{}
err := client.Call(nil, rpc.CodecProtobuf, ts.Service(), ts.Version(), "Test", &testReq, &testRsp)
if err != nil {
log.Error("client.Call(protobuf, TestService::Test) = error:%s", jerrors.ErrorStack(err))
return
}
log.Info("TestService::Test(protobuf, param:%#v) = res:%s", testReq, testRsp)
addReq := rpc_examples.AddReq{1, 10}
addRsp := rpc_examples.AddRsp{}
err = client.Call(rpc.CodecProtobuf, "127.0.0.1:10000", ts.Service(), "Add", &addReq, &addRsp)
addReq := micro_examples.AddReq{1, 10}
addRsp := micro_examples.AddRsp{}
err = client.Call(nil, rpc.CodecProtobuf, ts.Service(), ts.Version(), "Add", &addReq, &addRsp)
if err != nil {
log.Error("client.Call(protobuf, TestService::Add) = error:%s", jerrors.ErrorStack(err))
return
}
log.Info("TestService::Add(protobuf, req:%#v) = res:%#v", addReq, addRsp)
errReq := rpc_examples.ErrReq{1}
errRsp := rpc_examples.ErrRsp{}
err = client.Call(rpc.CodecProtobuf, "127.0.0.1:20000", ts.Service(), "Err", &errReq, &errRsp)
errReq := micro_examples.ErrReq{1}
errRsp := micro_examples.ErrRsp{}
err = client.Call(nil, rpc.CodecProtobuf, ts.Service(), ts.Version(), "Err", &errReq, &errRsp)
if err != nil {
// error test case, this invocation should step into this branch.
log.Error("client.Call(protobuf, TestService::Err) = error:%s", jerrors.ErrorStack(err))
......@@ -170,8 +170,8 @@ func testProtobuf() {
}
func test() {
for i := 0; i < 5; i++ {
testJSON()
for i := 0; i < 1; i++ {
// testJSON()
testProtobuf()
}
}
......@@ -10,5 +10,5 @@
package main
var (
Version = "0.9.2"
Version = "1.0.1"
)
#!/usr/bin/env bash
# ******************************************************
# DESC : getty rpc app devops script
# DESC : getty micro app devops script
# AUTHOR : Alex Stocks
# VERSION : 1.0
# LICENCE : LGPL V3
......
......@@ -9,7 +9,7 @@
# FILE : app.properties
# ******************************************************
export TARGET_EXEC_NAME="rpc_client"
export TARGET_EXEC_NAME="micro_client"
export BUILD_PACKAGE="app"
export TARGET_CONF_FILE="conf/config.toml"
......
# toml configure file
# toml中key的首字母可以小写,但是对应的golang中的struct成员首字母必须大写
AppName = "RPC-CLIENT"
AppName = "MICRO-CLIENT"
# host
LocalHost = "127.0.0.1"
......@@ -38,4 +38,14 @@ FailFastTimeout = "3s"
TcpWriteTimeout = "5s"
WaitTimeout = "1s"
MaxMsgLen = 1024
SessionName = "getty-rpc-client"
SessionName = "getty-micro-client"
[Registry]
Type = "zookeeper"
Addr = "127.0.0.1:2181"
# 与 registry 之间的 lease 时长
KeepaliveTimeout = 10
Root = "/getty-root"
IDC = "bj-yizhuang"
NodeID = "clt-node1"
Codec = "protobuf"
# toml configure file
# toml中key的首字母可以小写,但是对应的golang中的struct成员首字母必须大写
AppName = "RPC-CLIENT"
AppName = "MICRO-CLIENT"
# host
LocalHost = "127.0.0.1"
......@@ -38,4 +38,14 @@ FailFastTimeout = "3s"
TcpWriteTimeout = "5s"
WaitTimeout = "1s"
MaxMsgLen = 1024
SessionName = "getty-rpc-client"
SessionName = "getty-micro-client"
[Registry]
Type = "zookeeper"
Addr = "127.0.0.1:2181"
# 与 registry 之间的 lease 时长
KeepaliveTimeout = 10
Root = "/getty-root"
IDC = "bj-yizhuang"
NodeID = "clt-node1"
Codec = "protobuf"
# toml configure file
# toml中key的首字母可以小写,但是对应的golang中的struct成员首字母必须大写
AppName = "RPC-CLIENT"
AppName = "MICRO-CLIENT"
# host
LocalHost = "127.0.0.1"
......@@ -38,4 +38,14 @@ FailFastTimeout = "3s"
TcpWriteTimeout = "5s"
WaitTimeout = "1s"
MaxMsgLen = 1024
SessionName = "getty-rpc-client"
SessionName = "getty-micro-client"
[Registry]
Type = "zookeeper"
Addr = "127.0.0.1:2181"
# 与 registry 之间的 lease 时长
KeepaliveTimeout = 10
Root = "/getty-root"
IDC = "bj-yizhuang"
NodeID = "clt-node1"
Codec = "protobuf"
......@@ -2,7 +2,7 @@
// source: service.proto
/*
Package rpc_examples is a generated protocol buffer package.
Package micro_examples is a generated protocol buffer package.
It is generated from these files:
service.proto
......@@ -15,7 +15,7 @@
ErrReq
ErrRsp
*/
package rpc_examples
package micro_examples
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
......@@ -90,12 +90,12 @@ func (*ErrRsp) ProtoMessage() {}
func (*ErrRsp) Descriptor() ([]byte, []int) { return fileDescriptorService, []int{5} }
func init() {
proto.RegisterType((*TestReq)(nil), "rpc_examples.TestReq")
proto.RegisterType((*TestRsp)(nil), "rpc_examples.TestRsp")
proto.RegisterType((*AddReq)(nil), "rpc_examples.AddReq")
proto.RegisterType((*AddRsp)(nil), "rpc_examples.AddRsp")
proto.RegisterType((*ErrReq)(nil), "rpc_examples.ErrReq")
proto.RegisterType((*ErrRsp)(nil), "rpc_examples.ErrRsp")
proto.RegisterType((*TestReq)(nil), "micro_examples.TestReq")
proto.RegisterType((*TestRsp)(nil), "micro_examples.TestRsp")
proto.RegisterType((*AddReq)(nil), "micro_examples.AddReq")
proto.RegisterType((*AddRsp)(nil), "micro_examples.AddRsp")
proto.RegisterType((*ErrReq)(nil), "micro_examples.ErrReq")
proto.RegisterType((*ErrRsp)(nil), "micro_examples.ErrRsp")
}
func (this *TestReq) VerboseEqual(that interface{}) error {
if that == nil {
......@@ -480,7 +480,7 @@ func (this *TestReq) GoString() string {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&rpc_examples.TestReq{")
s = append(s, "&micro_examples.TestReq{")
s = append(s, "A: "+fmt.Sprintf("%#v", this.A)+",\n")
s = append(s, "B: "+fmt.Sprintf("%#v", this.B)+",\n")
s = append(s, "C: "+fmt.Sprintf("%#v", this.C)+",\n")
......@@ -492,7 +492,7 @@ func (this *TestRsp) GoString() string {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&rpc_examples.TestRsp{")
s = append(s, "&micro_examples.TestRsp{")
s = append(s, "A: "+fmt.Sprintf("%#v", this.A)+",\n")
s = append(s, "}")
return strings.Join(s, "")
......@@ -502,7 +502,7 @@ func (this *AddReq) GoString() string {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&rpc_examples.AddReq{")
s = append(s, "&micro_examples.AddReq{")
s = append(s, "A: "+fmt.Sprintf("%#v", this.A)+",\n")
s = append(s, "B: "+fmt.Sprintf("%#v", this.B)+",\n")
s = append(s, "}")
......@@ -513,7 +513,7 @@ func (this *AddRsp) GoString() string {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&rpc_examples.AddRsp{")
s = append(s, "&micro_examples.AddRsp{")
s = append(s, "Sum: "+fmt.Sprintf("%#v", this.Sum)+",\n")
s = append(s, "}")
return strings.Join(s, "")
......@@ -523,7 +523,7 @@ func (this *ErrReq) GoString() string {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&rpc_examples.ErrReq{")
s = append(s, "&micro_examples.ErrReq{")
s = append(s, "A: "+fmt.Sprintf("%#v", this.A)+",\n")
s = append(s, "}")
return strings.Join(s, "")
......@@ -533,7 +533,7 @@ func (this *ErrRsp) GoString() string {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&rpc_examples.ErrRsp{")
s = append(s, "&micro_examples.ErrRsp{")
s = append(s, "A: "+fmt.Sprintf("%#v", this.A)+",\n")
s = append(s, "}")
return strings.Join(s, "")
......
syntax = "proto2";
package rpc_examples;
package micro_examples;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
......
package rpc_examples
package micro_examples
import (
jerrors "github.com/juju/errors"
......
......@@ -16,6 +16,7 @@ import (
)
import (
"github.com/AlexStocks/getty/micro"
"github.com/AlexStocks/getty/rpc"
log "github.com/AlexStocks/log4go"
jerrors "github.com/juju/errors"
......@@ -27,8 +28,13 @@ const (
APP_LOG_CONF_FILE = "APP_LOG_CONF_FILE"
)
type microConfig struct {
rpc.ServerConfig
Registry micro.RegistryConfig
}
var (
conf *rpc.ServerConfig
conf *microConfig
)
func initConf() {
......@@ -42,13 +48,18 @@ func initConf() {
panic(fmt.Sprintf("application configure file name{%v} suffix must be .toml", confFile))
return
}
conf = &rpc.ServerConfig{}
conf = &microConfig{}
config.MustLoadWithPath(confFile, conf)
if err := conf.CheckValidity(); err != nil {
if err := conf.ServerConfig.CheckValidity(); err != nil {
panic(jerrors.ErrorStack(err))
return
}
if err := conf.Registry.CheckValidity(); err != nil {
panic(jerrors.ErrorStack(err))
return
}
// log
confFile = os.Getenv(APP_LOG_CONF_FILE)
if confFile == "" {
......
......@@ -19,8 +19,8 @@ import (
)
import (
"github.com/AlexStocks/getty-examples/rpc/proto"
"github.com/AlexStocks/getty/rpc"
"github.com/AlexStocks/getty-examples/micro/proto"
"github.com/AlexStocks/getty/micro"
"github.com/AlexStocks/goext/log"
"github.com/AlexStocks/goext/net"
log "github.com/AlexStocks/log4go"
......@@ -32,7 +32,7 @@ const (
)
var (
server *rpc.Server
server *micro.Server
)
func main() {
......@@ -64,12 +64,12 @@ func initProfiling() {
func initServer() {
var err error
server, err = rpc.NewServer(conf)
server, err = micro.NewServer(&conf.ServerConfig, &conf.Registry)
if err != nil {
panic(jerrors.ErrorStack(err))
return
}
err = server.Register(&rpc_examples.TestService{})
err = server.Register(&micro_examples.TestService{})
if err != nil {
panic(jerrors.ErrorStack(err))
return
......
......@@ -10,5 +10,5 @@
package main
var (
Version = "0.9.2"
Version = "1.0.1"
)
#!/usr/bin/env bash
# ******************************************************
# DESC : getty rpc app devops script
# DESC : getty micro app devops script
# AUTHOR : Alex Stocks
# VERSION : 1.0
# LICENCE : LGPL V3
......
......@@ -9,7 +9,7 @@
# FILE : app.properties
# ******************************************************
export TARGET_EXEC_NAME="rpc_server"
export TARGET_EXEC_NAME="micro_server"
export BUILD_PACKAGE="app"
export TARGET_CONF_FILE="conf/config.toml"
......
# toml configure file
# toml中key的首字母可以小写,但是对应的golang中的struct成员首字母必须大写
AppName = "RPC-SERVER"
AppName = "MICRO-SERVER"
Host = "127.0.0.1"
......@@ -30,4 +30,14 @@ FailFastTimeout = "3s"
TcpWriteTimeout = "5s"
WaitTimeout = "1s"
MaxMsgLen = 1024
SessionName = "getty-rpc-server"
SessionName = "getty-micro-server"
[Registry]
Type = "zookeeper"
Addr = "127.0.0.1:2181"
# 与 registry 之间的 lease 时长
KeepaliveTimeout = 10
Root = "/getty-root"
IDC = "bj-yizhuang"
NodeID = "srv-node1"
Codec = "protobuf"
\ No newline at end of file
# toml configure file
# toml中key的首字母可以小写,但是对应的golang中的struct成员首字母必须大写
AppName = "RPC-SERVER"
AppName = "MICRO-SERVER"
Host = "127.0.0.1"
......@@ -30,4 +30,14 @@ FailFastTimeout = "3s"
TcpWriteTimeout = "5s"
WaitTimeout = "1s"
MaxMsgLen = 1024
SessionName = "getty-rpc-server"
SessionName = "getty-micro-server"
[Registry]
Type = "zookeeper"
Addr = "127.0.0.1:2181"
# 与 registry 之间的 lease 时长
KeepaliveTimeout = 10
Root = "/getty-root"
IDC = "bj-yizhuang"
NodeID = "srv-node1"
Codec = "protobuf"
\ No newline at end of file
# toml configure file
# toml中key的首字母可以小写,但是对应的golang中的struct成员首字母必须大写
AppName = "RPC-SERVER"
AppName = "MICRO-SERVER"
Host = "127.0.0.1"
......@@ -30,4 +30,14 @@ FailFastTimeout = "3s"
TcpWriteTimeout = "5s"
WaitTimeout = "1s"
MaxMsgLen = 1024
SessionName = "getty-rpc-server"
SessionName = "getty-micro-server"
[Registry]
Type = "zookeeper"
Addr = "127.0.0.1:2181"
# 与 registry 之间的 lease 时长
KeepaliveTimeout = 10
Root = "/getty-root"
IDC = "bj-yizhuang"
NodeID = "srv-node1"
Codec = "protobuf"
\ No newline at end of file
#!/usr/bin/env bash
# ******************************************************
# DESC : getty rpc app devops script
# AUTHOR : Alex Stocks
# VERSION : 1.0
# LICENCE : LGPL V3
# EMAIL : alexstocks@foxmail.com
# MOD : 2018-08-06 13:23
# FILE : load.sh
# ******************************************************
APP_NAME="rpc_server"
APP_ARGS=""
SLEEP_INTERVAL=5
MAX_LIFETIME=4000
PROJECT_HOME=""
OS_NAME=`uname`
if [[ ${OS_NAME} != "Windows" ]]; then
PROJECT_HOME=`pwd`
PROJECT_HOME=${PROJECT_HOME}"/"
else
APP_NAME="rpc_server.exe"
fi
export APP_CONF_FILE=${PROJECT_HOME}"conf/config.toml"
export APP_LOG_CONF_FILE=${PROJECT_HOME}"conf/log.xml"
# export GOTRACEBACK=system
# export GODEBUG=gctrace=1
usage() {
echo "Usage: $0 start"
echo " $0 stop"
echo " $0 term"
echo " $0 restart"
echo " $0 list"
echo " $0 monitor"
echo " $0 crontab"
exit
}
start() {
APP_LOG_PATH=${PROJECT_HOME}"logs/"
mkdir -p ${APP_LOG_PATH}
APP_BIN=${PROJECT_HOME}sbin/${APP_NAME}
chmod u+x ${APP_BIN}
# CMD="nohup ${APP_BIN} ${APP_ARGS} >>${APP_NAME}.nohup.out 2>&1 &"
CMD="${APP_BIN}"
eval ${CMD}
PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
fi
CUR=`date +%FT%T`
if [ "${PID}" != "" ]; then
for p in ${PID}
do
echo "start ${APP_NAME} ( pid =" ${p} ") at " ${CUR}
done
fi
}
stop() {
PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
fi
if [ "${PID}" != "" ];
then
for ps in ${PID}
do
echo "kill -SIGINT ${APP_NAME} ( pid =" ${ps} ")"
kill -2 ${ps}
done
fi
}
term() {
PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
fi
if [ "${PID}" != "" ];
then
for ps in ${PID}
do
echo "kill -9 ${APP_NAME} ( pid =" ${ps} ")"
kill -9 ${ps}
done
fi
}
list() {
PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{printf("%s,%s,%s,%s\n", $1, $2, $9, $10)}'`
if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{printf("%s,%s,%s,%s,%s\n", $1, $4, $6, $7, $8)}'`
fi
if [ "${PID}" != "" ]; then
echo "list ${APP_NAME}"
if [[ ${OS_NAME} == "Linux" || ${OS_NAME} == "Darwin" ]]; then
echo "index: user, pid, start, duration"
else
echo "index: PID, WINPID, UID, STIME, COMMAND"
fi
idx=0
for ps in ${PID}
do
echo "${idx}: ${ps}"
((idx ++))
done
fi
}
monitor() {
idx=0
while true; do
PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
fi
if [[ "${PID}" == "" ]]; then
start
idx=0
fi
((LIFE=idx*${SLEEP_INTERVAL}))
echo "${APP_NAME} ( pid = " ${PID} ") has been working in normal state for " $LIFE " seconds."
((idx ++))
sleep ${SLEEP_INTERVAL}
done
}
crontab() {
idx=0
while true; do
PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
fi
if [[ "${PID}" == "" ]]; then
start
idx=0
fi
((LIFE=idx*${SLEEP_INTERVAL}))
echo "${APP_NAME} ( pid = " ${PID} ") has been working in normal state for " $LIFE " seconds."
((idx ++))
sleep ${SLEEP_INTERVAL}
if [[ ${LIFE} -gt ${MAX_LIFETIME} ]]; then
kill -9 ${PID}
fi
done
}
opt=$1
case C"$opt" in
Cstart)
start
;;
Cstop)
stop
;;
Cterm)
term
;;
Crestart)
term
start
;;
Clist)
list
;;
Cmonitor)
monitor
;;
Ccrontab)
crontab
;;
C*)
usage
;;
esac
# toml configure file
# toml中key的首字母可以小写,但是对应的golang中的struct成员首字母必须大写
AppName = "RPC-SERVER"
Host = "127.0.0.1"
Ports = ["10000", "20000"]
ProfilePort = 10086
# client与server之间连接的超时时间
SessionTimeout = "20s"
SessionNumber = 700
# app
FailFastTimeout = "3s"
# tcp
[GettySessionParam]
CompressEncoding = true
TcpNoDelay = true
TcpKeepAlive = true
KeepAlivePeriod = "120s"
TcpRBufSize = 262144
TcpWBufSize = 524288
PkgRQSize = 1024
PkgWQSize = 512
TcpReadTimeout = "1s"
TcpWriteTimeout = "5s"
WaitTimeout = "1s"
MaxMsgLen = 1024
SessionName = "getty-rpc-server"
<logging>
<filter enabled="true">
<tag>stdout</tag>
<type>console</type>
<!-- level is (:?FINEST|FINE|DEBUG|TRACE|INFO|WARNING|ERROR) -->
<level>DEBUG</level>
</filter>
<filter enabled="false">
<tag>debug_file</tag>
<type>file</type>
<level>DEBUG</level>
<property name="filename">logs/debug.log</property>
<property name="format">[%D %T] [%L] [%S] %M</property>
<property name="rotate">true</property> <!-- true enables log rotation, otherwise append -->
<property name="maxsize">0M</property> <!-- \d+[KMG]? Suffixes are in terms of 2**10 -->
<property name="maxlines">0K</property> <!-- \d+[KMG]? Suffixes are in terms of thousands -->
<property name="daily">true</property> <!-- Automatically rotates when a log message is written after midnight -->
</filter>
<filter enabled="true">
<tag>info_file</tag>
<type>file</type>
<level>INFO</level>
<property name="filename">logs/info.log</property>
<!--
%T - Time (15:04:05 MST)
%t - Time (15:04)
%D - Date (2006/01/02)
%d - Date (01/02/06)
%L - Level (FNST, FINE, DEBG, TRAC, WARN, EROR, CRIT)
%S - Source
%M - Message
It ignores unknown format strings (and removes them)
Recommended: "[%D %T] [%L] (%S) %M"
-->
<property name="format">[%D %T] [%L] [%S] %M</property>
<property name="rotate">true</property> <!-- true enables log rotation, otherwise append -->
<property name="maxsize">0M</property> <!-- \d+[KMG]? Suffixes are in terms of 2**10 -->
<property name="maxlines">0K</property> <!-- \d+[KMG]? Suffixes are in terms of thousands -->
<property name="daily">true</property> <!-- Automatically rotates when a log message is written after midnight -->
</filter>
<filter enabled="true">
<tag>warn_file</tag>
<type>file</type>
<level>WARNING</level>
<property name="filename">logs/warn.log</property>
<property name="format">[%D %T] [%L] [%S] %M</property>
<property name="rotate">true</property> <!-- true enables log rotation, otherwise append -->
<property name="maxsize">0M</property> <!-- \d+[KMG]? Suffixes are in terms of 2**10 -->
<property name="maxlines">0K</property> <!-- \d+[KMG]? Suffixes are in terms of thousands -->
<property name="daily">true</property> <!-- Automatically rotates when a log message is written after midnight -->
</filter>
<filter enabled="true">
<tag>error_file</tag>
<type>file</type>
<level>ERROR</level>
<property name="filename">logs/error.log</property>
<property name="format">[%D %T] [%L] [%S] %M</property>
<property name="rotate">true</property> <!-- true enables log rotation, otherwise append -->
<property name="maxsize">0M</property> <!-- \d+[KMG]? Suffixes are in terms of 2**10 -->
<property name="maxlines">0K</property> <!-- \d+[KMG]? Suffixes are in terms of thousands -->
<property name="daily">true</property> <!-- Automatically rotates when a log message is written after midnight -->
</filter>
</logging>
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment