日志:处理日志保存数量、大小
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
522
game-server/channelService.js
Normal file
522
game-server/channelService.js
Normal file
File diff suppressed because one or more lines are too long
@@ -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'
|
||||
},
|
||||
|
||||
@@ -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 启动游戏服务器
|
||||
@@ -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 启动游戏服务器
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user