config.js
1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/**
* config.js
* @author: feng.chen<feng.chen@yoho.cn>
* @date: 2017/04/13
*/
'use strict';
const isProduction = process.env.NODE_ENV === 'production';
const isTest = process.env.NODE_ENV === 'test';
const config = {
app: 'yoho-apm',
appVersion: '0.0.1', // 调用api的版本
port: 6003,
siteUrl: '//shop.yohobuy.com',
cookieDomain: '.yohobuy.com',
domains: [/yohobuy\.com^/],
loggers: {
infoFile: {
close: true,
name: 'info',
level: 'error',
filename: 'logs/info.log',
maxFiles: 7
},
errorFile: {
name: 'error',
level: 'error',
filename: 'logs/error.log',
handleExceptions: true,
maxFiles: 7
},
console: {
level: 'info',
colorize: 'all',
prettyPrint: true
}
},
report: {
host: 'influxd.yoho.cn',
db: 'web-apm',
measurement: 'api-duration',
duration: 2000,
records: 1
}
};
if (isProduction) {
Object.assign(module.exports, {
report: {
host: 'influxdblog.web.yohoops.org',
db: 'web-apm',
measurement: 'api-duration',
duration: 2000,
records: 10
}
});
}
if (isTest) {
Object.assign(module.exports, {
report: {
host: 'influxdblog.web.yohoops.org',
db: 'web-apm',
measurement: 'api-duration',
duration: 2000,
records: 10
}
});
}
module.exports = config;