Commit 4c48cd06 authored by 肖人杰's avatar 肖人杰

'增加日志打印'

parent 1d276621
......@@ -46,7 +46,7 @@ const http = axios.create({
// koa opentracing
// https://github.com/fapspirit/axios-opentracing
http.interceptors.request.use(function (config) {
console.log(JSON.stringify(global.serviceMap))
if(global.serviceMap) {
let paths = config.url.split("/")
if(paths.length >= 4){
......@@ -55,7 +55,7 @@ http.interceptors.request.use(function (config) {
config.url = config.url.replace(pathKey, global.serviceMap[pathKey])
}
}
console.log(config.url)
if (config.context && config.context.span) {
let tracer = opentracing.globalTracer();
let span = tracer.startSpan(`${config.method}: ${config.url}`, {
......
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