winston 日志管理4
配置File Transport
winston.add(winston.transports.File, options)
The File transport should really be the 'Stream' transport since it will accept any WritableStream. It is named such because it will also accept filenames via the 'filename' option:
- level: Level of messages that this transport should log.
- silent: Boolean flag indicating whether to suppress output.
- colorize: Boolean flag indicating if we should colorize output.
- timestamp: Boolean flag indicating if we should prepend output with timestamps (default true). If function is specified, its return value will be used instead of timestamps.
- filename: The filename of the logfile to write output to.
- maxsize: Max size in bytes of the logfile, if the size is exceeded then a new file is created, a counter will become a suffix of the log file.
- maxFiles: Limit the number of files created when the size of the logfile is exceeded.
- stream: The WriteableStream to write output to.
- json: If true, messages will be logged as JSON (default true).
- eol: string indicating the end-of-line characters to use (default to
\n
). - prettyPrint: If true, additional JSON metadata objects that are added to logging string messages will be displayed as a JSON string representation. If function is specified, its return value will be the string representing the meta.
- depth Numeric indicating how many times to recurse while formatting the object with
util.inspect
(only used withprettyPrint: true
) (default null, unlimited) - logstash: If true, messages will be logged as JSON and formatted for logstash (default false).
- showLevel: Boolean flag indicating if we should prepend output with level (default true).
- formatter: If function is specified and
json
is set tofalse
, its return value will be used instead of default output. (default undefined) - tailable: If true, log files will be rolled based on maxsize and maxfiles, but in ascending order. The filenamewill always have the most recent log lines. The larger the appended number, the older the log file. This option requires maxFiles to be set, or it will be ignored.
- maxRetries: The number of stream creation retry attempts before entering a failed state. In a failed state the transport stays active but performs a NOOP on it's log function. (default 2)
- zippedArchive: If true, all log files but the current one will be zipped.
- options: options passed to
fs.createWriteStream
(default{flags: 'a'}
).
Metadata: Logged via util.inspect(meta);
winston 日志管理4的更多相关文章
- winston日志管理1
Usage There are two different ways to use winston: directly via the default logger, or by instantiat ...
- winston日志管理3
Further Reading 延伸阅读 Events and Callbacks in Winston winston的事件和回调 Each instance of winston.Logger i ...
- winston日志管理2
上次讲到 Exceptions 例外 Handling Uncaught Exceptions with winston 使用winston处理未捕获的异常(这个如果对于异步,我不是很喜欢用) 使用 ...
- Nodejs日志管理包
Nodejs日志管理工具包:log4js 和 winston 1.log4js的使用 1)package.json中加入依赖 "log4js":"~0.6.21" ...
- 第13章 Linux日志管理
1. 日志管理 (1)简介 在CentOS 6.x中日志服务己经由rsyslogd取代了原先的syslogd服务.rsyslogd日志服务更加先进,功能更多.但是不论该服务的使用,还是日志文件的格式其 ...
- ABP(现代ASP.NET样板开发框架)系列之8、ABP日志管理
点这里进入ABP系列文章总目录 基于DDD的现代ASP.NET开发框架--ABP系列之8.ABP日志管理 ABP是“ASP.NET Boilerplate Project (ASP.NET样板项目)” ...
- 【Java EE 学习 76 下】【数据采集系统第八天】【通过AOP实现日志管理】【日志管理功能分析和初步实现】
一.日志管理相关分析 1.日志管理是一种典型的系统级别的应用,非常适合使用spring AOP实现. 2.使用日志管理的目的:对系统修改的动作进行记录,比如对权限.角色.用户的写操作.修改操作.删除操 ...
- ElasticSearch+NLog+Elmah实现Asp.Net分布式日志管理
本文将介绍使用NLOG.Elmah结合ElasticSearch实现分布式日志管理. 一.ElasticSearch简介 ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布 ...
- Apache 日志管理,获取客户端端口号
日志管理分类 日志文件是用户管理和监控 Apache 安全的非常好的第一手资料,它清晰地记录了客户端访问 Apache 服务器资源的每一条记录,以及在访问中出现的错误信息,可以这样说,Apache 可 ...
随机推荐
- safedog的小技巧
限制3389连接:下载SafedogServer\SafeDogGuardCenter\ProGuardData.ini回本地,然后本地搭建安全狗,覆盖,查看计算机名,修改自己计算机名再连接. 卸载安 ...
- switch,break和default语句练习
int w = 8; switch (w){ case 0: System.out.println("今天是星期日"); break; case 1: System.out.pri ...
- 对于PKI(公钥基础结构)及证书服务的通俗理解
对于PKI及证书服务的这些概念,相信初学者会有许多迷惑的地方,那是因为其中的某些关键概念没有理解清楚,我力争以通俗易懂的方式给初学者一些启示,也给以后自己忘了的时候一个参考:) ! 参考资料:http ...
- 使用Eclipse自带的Axis1插件生成WSDL文件
首先创建一个web工程,创建过程如下: 如果选择Apache Tomcat v5.5,Dynamic web module version最高只能选择2.4,填写完成后点击“下一步”: 填写默认输出文 ...
- sqlite相关工具使用
sqlite3可视化工具 1.sudo apt-get install sqlitebrowser 2.sudo apt-get install sqliteman3.sqlitestudio需要去官 ...
- [办公自动化] 再读《让EXCEL飞》(从excel导入access数据时,union联合查询,数据源中没有包含可见的表格)
一年多以前就买了@Mrexcel的<让excel飞>这本书.整体思路是利用access结合excel,大幅度提高数据分析效率. 最近又拿出来看了看.第十五章,比高级筛选更“高级”,P241 ...
- FlowVisor 安装
参考:Github-FlowVisor-wiki 第一步 添加公钥: 命令: $ wget http://updates.onlab.us/GPG-KEY-ONLAB $ sudo apt-key a ...
- JQUERY 一些技巧在实际中的应用
在jquery选择器中.继续做判断$("tr[rel!=" + id + "]").find('.status').html('--'); $("tr ...
- 获取checkbox复选框的值
<title>CheckBox</title> <script type = "text/javascript"> doGetVal: func ...
- EditPlus使用心得及常用快捷键
下载好烈火版EditPlus_4.00.465_SC 然后去官网下载自动补全ACP文件 我用的是php_stx_acp.zip 解压到editplus4主目录下 然后打开软件-设置-参数 先调字 ...