v1.2.7
添加多日志源功能,
ripple.Default().GetLog("alias")
logger.WithTo(ripple.Default().GetLog("box"), nil).Info("helloworld")
ripple.Default().GetLog("box").WithFields(nil).Info("helloworld2")
config file:
logs: [
{
"alias": "box",
"type": "sls",
"accessKeyId": "xxxxxxx",
"accessKeySecret": "xxxxxxx",
"endpoint": "xxxxxxx",
"allowLogLevel": "info",
"closeStdout": false,
"project": "boxlite",
"logstore": "xxxxxxx",
"topic": "*package",
"source": "source"
},
{
"alias": "user",
"type": "cls",
"accessKeyId": "xxxxxxx",
"accessKeySecret": "xxxxxxx",
"endpoint": "xxxxxxx",
"allowLogLevel": "info",
"closeStdout": false,
"project": "xxxxxxx",
"logstore": "xxxxxxx",
"topic": "topic",
"source": "source"
}
]
usage:
logger.WithTo(ripple.Default().GetLog("box"), nil).Info("helloworld")
or
ripple.Default().GetLog("box").WithFields(nil).Info("helloworld2")