Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/log4js-node/log4js-example
A full application that demonstrates how to configure log4js
https://github.com/log4js-node/log4js-example
javascript log4js-node
Last synced: 2 months ago
JSON representation
A full application that demonstrates how to configure log4js
- Host: GitHub
- URL: https://github.com/log4js-node/log4js-example
- Owner: log4js-node
- License: mit
- Created: 2014-07-02T10:51:09.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-04-15T03:05:07.000Z (almost 5 years ago)
- Last Synced: 2024-08-03T09:10:35.675Z (6 months ago)
- Topics: javascript, log4js-node
- Language: JavaScript
- Size: 6.84 KB
- Stars: 142
- Watchers: 16
- Forks: 115
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-star - log4js-example - node | 138 | (JavaScript)
README
log4js-example
==============A full express application that demonstrates how to configure log4js for the most common use-case.
To run:
```
npm install
npm start
```Log config
==========
Config file is in `config/log4js.json`. It defines three appenders that are children of the clustered appender. The clustered appender makes sure that only the master process writes to the log files, otherwise having multiple processes try to write at the same time will cause problems. Three log files are defined: `log/app.log` gets all the log messages and is configured to rotate when the file gets to 10Mb in size, keeping 3 backups of the file; `log/errors.log` uses the logLevelFilter to only get ERROR messages; `log/access.log` contains only the http request logs, using the connect-logger, and is configured to rotate every day.