配置 xprofiler 日志路径;增加 xtransit 配置文件

This commit is contained in:
liangtongchuan
2021-07-08 14:40:32 +08:00
parent a112732226
commit 9d52053ba0
2 changed files with 26 additions and 1 deletions

View File

@@ -1,4 +1,6 @@
require('xprofiler').start();
require('xprofiler').start({
log_dir: '/root/zyz/game-server/logs',
});
import { COM_TEAM_STATUS, STATUS } from './app/consts';
import {
createTcpAcceptor,

23
xtransitConfig.js Normal file
View File

@@ -0,0 +1,23 @@
// config
module.exports = {
// I. 必须的配置
server: 'ws://127.0.0.1:9092', // 填写前一节中部署的 xtransit-server 地址
appId: 2, // 创建应用得到的应用 ID
appSecret: '5dc97b37ad2cf51abb147db193a9ff46', // 创建应用得到的应用 Secret
// II. 比较重要的可选配置
disks: [], // 数组,配置需要监控的 disk 全路径
errors: [], // 数组,配置需要监控的 error 日志全路径
packages: [], // 数组,配置需要监控的项目依赖文件全路径
// III. 不是很重要的可选的配置
logDir: './game-server/logs', // xprofiler 插件生成性能日志文件的目录,默认两者均为 os.tmpdir()
docker: false, // 默认 false, 系统数据采集会依赖当前是否是 docker 环境而进行一些特殊处理,可以手动强制指定当前实例是否为 docker 环境
ipMode: false, // 默认 false此时仅使用 hostname 作为 agentId设置为 true 后 agentId 组装形式为 ${ip}_${hostname}
libMode: false, // 默认 false此时采集如果收到 shutdown 事件会退出当前进程;如果是以第三方库的形式引用接入应用内,请将此属性设置为 true
errexp: /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/i, // 匹配错误日志起始的正则,默认为匹配到 YYYY-MM-DD HH:mm:ss 时间戳即认为是一条错误日志的起始
logger: console, // 可以传入应用日志句柄方便日志统一管理,需要实现 error, info, warn 和 debug 四个方法
logLevel: 2, // 默认内置 logger 的日志级别0 error1 info2 warning3 debug,
titles: [], // 数组,如果应用使用了 process.title 自定义了名称,可以通过配置这里上报进程数据
};