Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d64d4ca

Browse files
author
Gareth Jones
committed
updated to remove TODO and credit danbell
1 parent b338b34 commit d64d4ca

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is a conversion of the [log4js](http://log4js.berlios.de/index.html)
44
framework to work with [node](http://nodejs.org). I've mainly stripped out the browser-specific code
55
and tidied up some of the javascript. It includes a basic file logger, with log rolling based on file size, and also replaces node's console.log functions.
66

7-
NOTE: in v0.2.x require('log4js') returned a function, and you needed to call that function in your code before you could use it. This was to make testing easier. v0.3.x make use of [felixge's sandbox-module](https://github.com/felixge/sandbox-module), so we don't need to return a function.
7+
NOTE: in v0.2.x require('log4js') returned a function, and you needed to call that function in your code before you could use it. This was to make testing easier. v0.3.x make use of [felixge's sandbox-module](https://github.com/felixge/node-sandboxed-module), so we don't need to return a function.
88

99
## installation
1010

@@ -55,15 +55,9 @@ configuration file (`log4js.configure('path/to/file.json')`) explicitly, or just
5555
An example file can be found in `test/log4js.json`. An example config file with log rolling is in `test/with-log-rolling.json`
5656
You can also pass an object to the configure function, which has the same properties as the json versions.
5757

58-
## todo
59-
60-
patternLayout has no tests. This is mainly because I haven't found a use for it yet,
61-
and am not entirely sure what it was supposed to do. It is more-or-less intact from
62-
the original log4js.
63-
6458
## connect/express logger
6559

66-
A connect/express logger has been added to log4js. This allows connect/express servers to log using log4js. See example-connect-logger.js.
60+
A connect/express logger has been added to log4js, by [danbell](https://github.com/danbell). This allows connect/express servers to log using log4js. See example-connect-logger.js.
6761

6862
var log4js = require('./lib/log4js');
6963
log4js.addAppender(log4js.consoleAppender());

lib/layouts.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,16 @@ function messagePassThroughLayout (loggingEvent) {
120120

121121
/**
122122
* PatternLayout
123-
*
123+
* Format for specifiers is %[padding].[truncation][field]{[format]}
124+
* e.g. %5.10p - left pad the log level by 5 characters, up to a max of 10
125+
* Fields can be any of:
126+
* - %r time in toLocaleTimeString format
127+
* - %p log level
128+
* - %c log category
129+
* - %m log data
130+
* - %d date in various formats
131+
* - %% %
132+
* - %n newline
124133
* Takes a pattern string and returns a layout function.
125134
* @author Stephan Strittmatter
126135
*/

0 commit comments

Comments
 (0)