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

@vededoc/l4app

v1.1.3

Published

lightweight logging utility

Downloads

4

Readme

l4app

logging utility for applications.

Features

  • simple, lightweight logging utility
  • capture stdout and stderr of application, save them to files.
  • daily log rotation
  • limit max file size, count, duration
  • compress logs as gzip format for backup
  • change shown process name

Installation

$ sudo npm i -g @vededoc/l4app

Usage

After '--', pass over your application arguments.
For example, 'ls -al' is
$ l4app ls -- -al

# max log files is 10, duration for keeping log files is 30day, max file size is 1mega 
$ l4app your_app -w working_folder --duration 30d --max-size 1M --max-logs 10 -- arg1 arg2

# for nodejs application
$ l4app node -w working_folder -- your_app.js

# run in background
$ nohup l4app node -- your_app > /dev/null &

# changing log setting on the fly, default working_folder is current folder
$ l4app --set --max-size 10M --logs 10 [working_folder]

# get current log setting on working-folder
$ l4app --get [working_folder]

# kill l4app instance, default working_folder is current folder
$ l4app -k [working_folder]

Log file naming rule

{prefix}_output_{START_DATE}_{END_DATE}_{INDEX}.log

prefix is from commaind line option ( --prefix, default is none )
START_DATE is date-time of logging start date-time. format is 'MMDD'
END_DATE is date-time of logging last date-time. format is 'MMHHMM'
INDEX is 1,2,3,... for the same date-time

Options

Options:
  -w, --work-dir <working-dir>    working folder for logging
  --no-error-file                 do not make error.log
  --max-size <size>               max log size, default: 10M
  --duration <duration>           keeping duration for log files. valid values
                                  => 1d, 24h, ...
                                  ex) '--duration 30d' means keeping logs for
                                  30 days
  --logs <max-log-num>            max log files, default is 30
  -z, --zip                       compress backup logs
  -n, --name-proc <process-name>  change process name, just only valid for
                                  nodejs package
                                  ex) l4app node -n testapp -- test.js
  -s, --screen                    print out for screen
  --check-interval <time>         interval for checking duration, counts, size
                                  of log files
                                  ex) '--check-interval=1m'
  -p, --prefix <prefx>            prefix for log file
  -k, --kill                      kill app
  --set                           change log setting on the fly and terminate
  --get                           get current log settings
  --disable-zip                   disable compress
  -- <arguments>                  application arguments
  -V, --version                   output the version number
  -h, --help                      display help for command