日志:处理日志保存数量、大小

This commit is contained in:
luying
2022-01-07 18:55:28 +08:00
parent e579457a39
commit f15b6319e3
6 changed files with 533 additions and 9 deletions

View File

@@ -8,7 +8,7 @@ import { UserModel } from "../../../db/User";
import { SERVER_DEBUG_MODE } from "../../../pubUtils/dicParam";
import { nowSeconds } from "../../../pubUtils/timeUtil";
import { getServerMainten } from "../../../services/gmService";
import { errlogger } from "../../../util/logger";
// import { errlogger } from "../../../util/logger";
export function globalFilter(app: Application) {
return new Filter(app);
}
@@ -32,7 +32,7 @@ Filter.prototype.before = async function (routeRecord: RouteRecord, msg: any, se
if(this.accessTime && this.accessTime.has(keyOfRouteWithUser)) {
console.log(this.accessTime.get(keyOfRouteWithUser) - Date.now());
if(Date.now() - this.accessTime.get(keyOfRouteWithUser) < ACCESS_FREQUENCY) {
errlogger.error(`${keyOfRouteWithUser} 间隔时间小于${ACCESS_FREQUENCY}ms${Date.now() - this.accessTime.get(keyOfRouteWithUser)}`);
// errlogger.error(`${keyOfRouteWithUser} 间隔时间小于${ACCESS_FREQUENCY}ms为 ${Date.now() - this.accessTime.get(keyOfRouteWithUser)}`);
// return next(new Error(), resResult(STATUS.ACCESS_BUSY));
}
}

File diff suppressed because one or more lines are too long

View File

@@ -61,11 +61,11 @@ module.exports = {
'pinus': {
'type': 'file',
'filename': '/zyz_logs/log4js/pinus-${opts:serverId}.log',
'maxLogSize': 1048576,
'maxLogSize': 1073741824,
'layout': {
'type': 'basic'
},
'backups': 5
'backups': 20
},
'pinus-admin': {
'type': 'file',
@@ -88,16 +88,16 @@ module.exports = {
'app': {
'type': 'file',
'filename': '/zyz_logs/sls/app.log',
'maxLogSize': 10485760,
'maxLogSize': 1073741824,
'layout': {
'type': 'basic'
},
'backups': 15
'backups': 20
},
'error': {
'type': 'file',
'filename': '/zyz_logs/sls/error.log',
'maxLogSize': 1048576,
'maxLogSize': 1073741824,
'layout': {
'type': 'basic'
},

View File

@@ -1,5 +1,6 @@
#/bin/bash
npm install #安装依赖库
cp ./channelService.js ./node_modules/pinus/dist/lib/common/service/channelService.js
npm run build
node pm2Config.js #使用pm2来做进程管理生成进程配置文件
pm2 start pomeloPm2Start.json #pm2 启动游戏服务器
pm2 start pomeloPm2Start.json #pm2 启动游戏服务器

View File

@@ -9,6 +9,7 @@ if [ $# != 2 ] ; then
fi
npm install #安装依赖库
cp ./channelService.js ./node_modules/pinus/dist/lib/common/service/channelService.js
npm run build
node pm2DistributeConfig.js ${1} ${2} #使用pm2来做进程管理生成进程配置文件
pm2 start pomeloPm2Start.json #pm2 启动游戏服务器

View File

@@ -238,7 +238,7 @@ export const GK_MAINELITE = {
GKMAINELITE_OPEN_CONDITION: 424, // 梦魇模式开启时间通过某关卡id
};
export const SERVER_DEBUG_MODE = {
CURRENT_TIME: 1, // 服务器是否打开推送时间debug模式
CURRENT_TIME: 0, // 服务器是否打开推送时间debug模式
CHECK_WORD: 1, // 服务器是否打开屏蔽词校验debug模式
};
export const IS_SQ = {