https://github.com/ww24/log4js-node-extend
log4js + line number
https://github.com/ww24/log4js-node-extend
log4js nodejs
Last synced: about 2 months ago
JSON representation
log4js + line number
- Host: GitHub
- URL: https://github.com/ww24/log4js-node-extend
- Owner: ww24
- License: apache-2.0
- Created: 2014-02-18T03:22:34.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-08-15T18:09:25.000Z (almost 8 years ago)
- Last Synced: 2025-03-20T07:13:30.117Z (2 months ago)
- Topics: log4js, nodejs
- Language: JavaScript
- Size: 13.7 KB
- Stars: 28
- Watchers: 3
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
log4js-node-extend [](http://travis-ci.org/ww24/log4js-node-extend) [](https://gemnasium.com/ww24/log4js-node-extend)
==================It add useful meta data of code (file-name, function-name line-number, column-number) for `log4js-node`.
Example
---------
```
[2014-02-18 12:24:14.238] [INFO] category - test at (test.js:57:9)
```Installation
---------
```
npm install log4js-extend
```Usage
---------
```js
const log4js = require("log4js");
const log4js_extend = require("log4js-extend");log4js_extend(log4js, {
path: __dirname,
format: "at @name (@file:@line:@column)"
});const logger = log4js.getLogger("category");
logger.info("test");
```Options
---------
### path
Use relative path from path directory.default: `null`
### format
Simple log format.default: `"at @name (@file:@line:@column)"`
#### Keywords will replace as below.
* @name : function name
* @file : file name
* @line : line number
* @column : column number