Comments (11)
有空的话请把你的修改和问题描述清楚一点。明天帮你分析分析。
from pinus.
{
"appenders": {
"console": {
"type": "console"
},
"con-log": {
"type": "file",
"filename": "${opts:base}/logs/con-log-${opts:serverId}.log",
"pattern": "connector",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"rpc-log": {
"type": "file",
"filename": "${opts:base}/logs/rpc-log-${opts:serverId}.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"forward-log": {
"type": "file",
"filename": "${opts:base}/logs/forward-log-${opts:serverId}.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"rpc-debug": {
"type": "file",
"filename": "${opts:base}/logs/rpc-debug-${opts:serverId}.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"crash-log": {
"type": "file",
"filename": "${opts:base}/logs/crash.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"admin-log": {
"type": "file",
"filename": "${opts:base}/logs/admin.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"pomelo": {
"type": "file",
"filename": "${opts:base}/logs/pinus-${opts:serverId}.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"pinus-admin": {
"type": "file",
"filename": "${opts:base}/logs/pinus-admin.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"pinus-rpc": {
"type": "file",
"filename": "${opts:base}/logs/pinus-rpc-${opts:serverId}.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
}
},
"categories": {
"default": {
"appenders": [
"console",
"con-log",
"rpc-log",
"forward-log",
"rpc-debug",
"crash-log",
"admin-log",
"pomelo",
"pinus-admin",
"pinus-rpc"
],
"level": "debug"
}
},
"prefix": "${opts:serverId} ",
"replaceConsole": true,
"lineDebug": false,
"errorStack": true
}
这是项目里面log4js.json 的默认配置
from pinus.
{
"appenders": {
"console": {
"type": "console"
},
"con-log": {
"type": "file",
"filename": "${opts:base}/logs/con-log-${opts:serverId}.log",
"pattern": "connector",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"rpc-log": {
"type": "file",
"filename": "${opts:base}/logs/rpc-log-${opts:serverId}.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"forward-log": {
"type": "file",
"filename": "${opts:base}/logs/forward-log-${opts:serverId}.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"rpc-debug": {
"type": "file",
"filename": "${opts:base}/logs/rpc-debug-${opts:serverId}.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"crash-log": {
"type": "file",
"filename": "${opts:base}/logs/crash.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"admin-log": {
"type": "file",
"filename": "${opts:base}/logs/admin.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"pomelo": {
"type": "file",
"filename": "${opts:base}/logs/pinus-${opts:serverId}.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"pinus-admin": {
"type": "file",
"filename": "${opts:base}/logs/pinus-admin.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"pinus-rpc": {
"type": "file",
"filename": "${opts:base}/logs/pinus-rpc-${opts:serverId}.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"cnjj-log": {
"type": "file",
"filename": "${opts:base}/logs/cnjj-log.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
},
"global-log": {
"type": "file",
"filename": "${opts:base}/logs/global-log.log",
"maxLogSize": 1048576,
"layout": {
"type": "basic"
},
"backups": 5
}
},
"categories": {
"default": {
"appenders": [
"console",
"con-log",
"rpc-log",
"forward-log",
"rpc-debug",
"crash-log",
"admin-log",
"pomelo",
"pinus-admin",
"pinus-rpc",
"cnjj-log",
"global-log"
],
"level": "debug"
}
},
"prefix": "${opts:serverId} ",
"replaceConsole": true,
"lineDebug": false,
"errorStack": true
}
当我添加了 cnjj-log 和global-log的日志后启动项目就报错了
from pinus.
[2019-02-12T11:35:20.593] [ERROR] logger - [adminConnector-server-1 console] (node:16316) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added. Use emitter.setMaxListeners() to increase limitError
at Object.pLogger.(anonymous function) [as error] (C:\all\cnjj-server-ts\node_modules\pinus-logger\lib\logger.ts:72:34)
at writeOut (internal/process/warning.js:18:20)
at output (internal/process/warning.js:69:3)
at process.on (internal/process/warning.js:100:7)
at emitOne (events.js:116:13)
at process.emit (events.js:211:7)
at internal/process/warning.js:74:13
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:686:11)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
这是报错的堆栈
from pinus.
把我加的那两个日志配置删除,启动就不会报上面的错
from pinus.
这个是 log4js的问题。
pinus-logger只是对 log4js的一层简单封装。
from pinus.
那有没有什么办法可以解决这个问题呢
from pinus.
对 log4js不太了解。 抱歉帮不上忙。
我用的是 @mybios 给我的精简版配置,不写日志文件的。
可以给你参考一下
{
"appenders": {
"displayConsole": {
"type": "console"
},
// "other": {
// "type": "file",
// "filename": "${opts:base}/logs/${opts:serverId}.log",
// "maxLogSize": 1048576,
// "layout": {
// "type": "basic"
// },
// "backups": 5
// }
},
"categories": {
"default": {
"appenders": [
/*"other",*/"displayConsole"
],
"level": "debug"
}
},
"replaceConsole": true,
"prefix": "${opts:serverId} ",
"lineDebug": false,
"errorStack": true
}
from pinus.
好的 谢谢
from pinus.
老哥,这个报错说的是对一个eventEmitter的监听超出默认限制。这个情况出现的原因是有不停的为同一个Event添加监听的情况。
你看看有没有执行的过程中会导致这个情况出现的?这个应该是由于某个逻辑出错后尝试重新加载的逻辑里有添加事件监听导致的
from pinus.
示例项目 已经对 log4js.json的配置做了修复,因为 Log4js的新版本 配置方法不一样。
from pinus.
Related Issues (20)
- 示例工程中运执行npm-install.bat报错怎么处理 HOT 3
- pinus-admin-web不能正常显示监控数据 HOT 4
- 解决一下严格模式问题
- protobuf支持map吗? HOT 11
- 请问指南中完整的mmo游戏demo在哪里 HOT 1
- pinus-robot 启动master节点连接报错 {"code":5,"message":"Unsupported protocol version"} HOT 2
- [pinus-admin] pinus-admin客户端connect问题。 HOT 2
- 请问下如何服务器和客户端之间的消息如何启用 compressGzip 进行压缩 HOT 2
- 有人了解colyseus这个游戏框架吗?有跟pinus对比过吗
- pinus-logger模块打印对象时,显示[object object]的问题 HOT 4
- 客户端build.js和服务器怎么感觉没有适配好? HOT 4
- 有没遇到过这种情况?master请求其他实例失败,下面是报错日志,有新的connector服务加入,通知其他connector好像失败了 HOT 2
- 其他服务与master断开连接后,会触发master不断的重连,这个重连好像不会停止,还是说有什么地方可以配置 HOT 4
- connector性能瓶颈 HOT 8
- jsclient-websocket, request的第128个请求得不到返回 HOT 1
- app.rpcInvoke is not a function HOT 1
- 启动不了,报错 (`node:stream/web`) HOT 4
- 快速入门有些操作会报错,不知nodejs版本要求多少 10.x,14.x,20.x都试过 HOT 3
- npm 上的版本太老了,能不能发个最新版 HOT 2
- 关于业务逻辑的热更思考 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pinus.