npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

log-master

v1.0.0

Published

split the log

Downloads

34

Readme

log-master 1.0.0

简单的Log定时切割工具。可切割正在被写入的log文件,并保持完整性。

不支持window平台。

安装

npm install log-master

使用方法

split

将本机上所有log用时间分割,汇集到一个文件夹里。

var logMaster = require('log-master');
logMaster.split({ //切割,目前唯一的功能
  "from": { //源文件夹,可多选。
    "forever": "/root/.forever",
    "app1": "/app1logdir",
    "app2": "/app2logdir"
  },
  "Suffix": [".log"], //要切割的文件类型,可多选。默认 [".log"]
  "to": __dirname, //目标文件夹,log都会到这里。
  "Interval": 1000 * 60 * 60 * 24, //切割时间间隔,默认一天。
  "timeFormat": "yyyy年MM月dd日HH时mm分ss秒", //时间格式(生成的文件夹名),默认为yyyy年MM月dd日HH时mm分ss秒
  "startTime": "00:00" //开始时间,默认零点,精确到秒的话就:"00:00:00"
});

运行

nohup node youapp.js &

或用其它守护进程比如:pm2, forever

注意

手动输出Log时需要使用 >> 而不是 > 符号。例:

使用 > 将会得到:

nohup node ./loop.js >/somedir/you.log &

image 在vim下看,切割后的文件会包含之前被清空的占位符,并且体积逐渐增大。

使用 >> 才会得到你想要的结果。

nohup node ./loop.js >>/somedir/you.log &

image