Giter VIP home page Giter VIP logo

winston-logfile's Introduction

winston-logfile

winston日志文件读写统计

log日志读写,html页面查阅log统计数据

使用步骤:

  1. 运行 node winston1.js 可以写入测试log日志,日志文件按天写入
  2. 运行 node readlog.js 可以启动服务来访问日志统计页面,如:http://127.0.0.1:3000/index
  3. 如果想自动监控js代码更新来重启node服务请使用命令 nodemon readlog.js 代替 node readlog.js命令,当然你的电脑必须安装 nodemon

本日志案例基于winston,也是目前公司所使用的一种log方案,因为产品希望看到每天数据请求的关键字统计结果,所以写了这么个页面,当然这个并不适合大数据量的统计,还是落到DB库的数据比较好,如果只是满足简单临时的需求可以一用,落地的log方案只适合记录一些node机器异常的小量数据。

目前推荐的日志库如下: Winston Bunyan log4js 选择哪个看你公司日志使用情况和业务,目前推荐Winston较多~~

winston-logfile's People

Stargazers

Roman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.