@achingbrain/node-syslog 中文文档教程
Node-Syslog
v1.2.0
这是一个节点模块(附加组件),用于在 unix 系统上使用 syslog(系统日志)守护进程。 此模块已经过测试:
- node.js v0.8.16
- version v0.9.3
- metalog
- syslog-ng 3.1.1
阅读 setMask wiki 页面以使用 setMask
功能。
当前版本与节点 0.8.x 及更高版本兼容。 对于旧的 node.js 版本,请使用 node-syslog v1.0.3
Node-syslog 不正式支持 Darwin OS 和 MS Windows,但应该可以正常工作。
Authors
- Nazar Kulyk
- Jeremy Childs
- Sam Roberts
- Ben Noordhuis
Installation
npm
npm install node-syslog
manual
git clone
node-gyp configure build
Usage
有关如何使用模块的更多信息,请检查 test.js
var Syslog = require('node-syslog');
Syslog.init("node-syslog", Syslog.LOG_PID | Syslog.LOG_ODELAY, Syslog.LOG_LOCAL0);
Syslog.log(Syslog.LOG_INFO, "Node Syslog Module output " + new Date());
Syslog.close();
检查 /var/log/messages(syslog、syslog-ng)或 /var/log/everything/current (metalog) 文件中的任何测试条目。
Node-Syslog
v1.2.0
This is a node module (add-on) to work with syslog (system log) daemon on unix systems. This module has been tested with:
- node.js v0.8.16
- version v0.9.3
- metalog
- syslog-ng 3.1.1
Read the setMask wiki page for using the setMask
functionality.
The current version is compatible to node 0.8.x and higher. For older node.js versions, please use node-syslog v1.0.3
Node-syslog does not officially support Darwin OS and MS Windows but should work fine.
Authors
- Nazar Kulyk
- Jeremy Childs
- Sam Roberts
- Ben Noordhuis
Installation
npm
npm install node-syslog
manual
git clone
node-gyp configure build
Usage
For more information about how to use module check test.js
var Syslog = require('node-syslog');
Syslog.init("node-syslog", Syslog.LOG_PID | Syslog.LOG_ODELAY, Syslog.LOG_LOCAL0);
Syslog.log(Syslog.LOG_INFO, "Node Syslog Module output " + new Date());
Syslog.close();
Check your /var/log/messages (syslog, syslog-ng), or /var/log/everything/current (metalog) file for any test entry.