33 Commits

Author SHA1 Message Date
Gareth Jones
906a77403d chore(lint): added linting to test files 2017-11-14 08:45:22 +11:00
Gareth Jones
4333261721 fix(levels): added level configuration, fixed smtp appender 2017-03-09 08:28:41 +11:00
e-cloud
7d9dc55ff2 style: upgrade eslint and format the code
no logic changed.
2016-12-12 21:04:34 +08:00
e-cloud
50ce5030df Merge remote-tracking branch 'refs/remotes/upstream/master'
Conflicts:
	lib/appenders/gelf.js
	lib/connect-logger.js
2016-07-18 15:50:52 +08:00
e-cloud
9cc3a88bd7 refactor: more small refactor
1. drop semver related code with no need to detect node version
2. drop license declaration in log4js.js for there is one in the project dir
3. other changes
2016-07-16 13:49:24 +08:00
e-cloud
6146334d01 refactor: connect-logger.js 2016-07-15 19:47:16 +08:00
e-cloud
5328e03802 refactor: just format code according to the editor config(tests passed) 2016-07-14 17:36:30 +08:00
Abrar Ahmed
552a7177bc add req.url so that connect works with restify 2016-07-11 16:06:00 -07:00
Abrar Ahmed
bcc3d4630f add req.url so that connect works with restify 2016-07-11 16:01:21 -07:00
Abrar Ahmed
b55eb70d03 add req.url so that connect works with restify 2016-07-11 15:02:07 -07:00
Gareth Jones
97fc892c00 fixing some jshint errors 2016-04-29 09:11:17 +10:00
Hugues Malphettes
6746e2e048 remove the underscore dependency 2016-01-06 11:23:40 +08:00
Gareth Jones
25cf884f97 Merge branch 'MaxXx1313-master' 2015-06-11 07:11:30 +10:00
Francisco Dans
3bf2bade32 x-forwarded-for 2015-06-01 15:30:46 +02:00
MaxXx1313
799af3be5d add protocol and hostname to output format for express 2015-04-29 17:10:05 +03:00
Christo Fogelberg
25c543f8ae lib/connect-logger.js - allow options.tokens 2015-03-10 06:18:02 +00:00
Christo Fogelberg
24268422cf lib/connect-logger.js - format takes tokens array instead of req, res 2015-03-10 06:13:49 +00:00
Christo Fogelberg
ba80dc1588 Trailing whitespace Sublime removed 2015-03-08 19:36:17 +00:00
osher
cd3971cc03 fix bug: headers are changed after log entry emits
In the original version, the following operation looks synchronic, however it is not:

```
res.end = end;
res.end(data,enc);

//emit the log entry 
```

In fact, it starts a series of async operations, in which the request may yet be changed after the request log has already been emitted
(in our case - a change on request headers was observed, probably by some low level hook or hacky wrap of some http.ServerResponse method that's involved on the process - but called asynchronously)
what leads to situation that the request log does not capture valid data.
(observed by us:
 - request headers
 - calculated end time, when concerning big content
)

The fix just used `setTimeout(function() { /*emit the log entry*/ }, 1)`, but I'm afraid it may not hold true for big contents.
Well. maybe the headers part will, but the response time calculation will lie.

The fix relays on: http://nodejs.org/api/http.html#http_event_finish
2014-11-04 17:28:52 +02:00
mishless
66872d136d Update connect-logger.js to work correctly with express
When used with express levels are wrong since send() does not call writeHead, but sets responseCode on response.
2014-07-30 13:06:51 +03:00
Matthias Adler
2118d8f7b3 fix 'remote-addr' property in connect-logger 2013-12-21 19:42:44 +01:00
Gareth Jones
81fa9c3568 removed unnecessary argument to createNoLogCondition 2013-06-05 08:38:39 +10:00
Gareth Jones
7ca517b5ed simplified createNoLogCondition 2013-06-05 08:37:27 +10:00
Gareth Jones
5d6f00eda4 fixed all lint errors except ones which require refactoring of code 2013-06-04 08:17:36 +10:00
Jure Mav
ac6284add1 Added automatic level detection to connect-logger, depends on http status response.
Update of connect logger example code, compatible with express 3.x
2013-05-11 16:17:23 +02:00
Gareth Jones
61078e88ef fixed the nolog tests 2012-05-09 16:40:27 +10:00
Peter 'Pita' Martischka
4cf1d1cfa4 Fixed a BUG that prevents connectlogger from working if loglevel is WARN 2011-12-07 15:28:35 +01:00
muddydixon
5aabebbdb7 change check target from req.url to req.originalUrl 2011-10-29 11:55:46 +09:00
muddydixon
b5bc9c8322 mod if nolog 2011-10-25 14:28:46 +09:00
muddydixon
c7d3ac4fe1 add nolog operation 2011-10-25 14:09:41 +09:00
Gareth Jones
0968c6709f fixed connect-logger 2011-07-19 09:08:15 +10:00
Gareth Jones
e121ca345a removed main function, now using felixge's sandboxed-module, split code into multiple files 2011-07-12 13:02:48 +10:00
Daniel Bell
59f7e0af3c Added connect/express logger. 2011-04-07 10:19:18 +10:00