752 Commits

Author SHA1 Message Date
Lam Wei Li
bc59c87050
Merge pull request #1401 from MamfTheKramf/http-response-chaining
fix: enable method chaining for after writeHead
2024-04-05 13:55:29 +08:00
Lam Wei Li
e1efb82829
fix(LoggingEvent): serde for object with null prototype 2024-04-04 15:30:56 +08:00
Mamf
24a6e36d94 Enable method chaining for after writeHead.
writeHead now also returns a reference to the response object as specified here: https://nodejs.org/api/http.html#responsewriteheadstatuscode-statusmessage-headers
2023-10-24 21:40:56 +02:00
gabriel-cloud
cd8b019e3f add maxLength to recording 2023-05-19 22:02:24 +00:00
Lam Wei Li
2628688852
fix(7922e82): regex for stacktrace 2023-03-08 23:13:51 +08:00
aje
d0f5b70b1d Idempotent logging on browser
Certain modules do not exist in a browser environment.
In that environment, file-based appenders are effectively
disabled by this commit, without modifying the source directly.
2023-03-07 14:26:12 +08:00
Lam Wei Li
df8931703b
feat: added log4js.isConfigured() API 2023-02-20 13:31:02 +08:00
Lam Wei Li
7922e82578
fix: flagged regex by codeql for security and performance 2023-02-20 02:04:20 +08:00
Lam Wei Li
243592baf9
fix: tilde expansion 2023-02-20 02:03:10 +08:00
Benoît Lefèvre
0632c2197e feat issue #1341 (Layouts) : taking into account code review's feedback 2022-12-03 22:49:28 +01:00
Benoît Lefèvre
e01c3c7bbf feat issue #1341 (Layouts) : use split instead of regexp 2022-11-30 23:21:46 +01:00
Benoît Lefèvre
ab43399200 feat issue #1341 (Layouts) : fix typo & add related doc entry 2022-11-28 10:04:25 +01:00
Benoît Lefèvre
aedef32bb9 feat issue #1341 (Layouts) : support a specifier on %m 2022-11-14 02:13:14 +01:00
Lam Wei Li
d2ef2628a7
refactor(log4js): no need for .reduceRight(), use .reduce() instead 2022-10-02 02:54:58 +08:00
Lam Wei Li
a10f4a2941
feat(log4js): if cb is passed to shutdown(), it must be a function or it will throw error immediately 2022-10-02 02:54:57 +08:00
Lam Wei Li
6f697ad317
fix(LoggingEvent): throws error for invalid location passed when creating a new LoggingEvent 2022-10-02 01:15:05 +08:00
Lam Wei Li
31ae2b258d
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one 2022-10-02 00:54:50 +08:00
Lam Wei Li
ffa9e5e2e4
refactor: typeof to check for undefined (because undefined can be a variable name) 2022-10-01 18:38:14 +08:00
Lam Wei Li
6f9c436896
fix(LoggingEvent): serde for NaN, Infinity, -Infinity, undefined 2022-10-01 18:37:41 +08:00
Zachary Haber
0089e784b4
refactor: remove duck typing 2022-09-30 00:55:23 +08:00
Zachary Haber
b1598c04c7
feat: add error to logging event from logger 2022-09-30 00:55:20 +08:00
Zachary Haber
0683535e0f
feat: add error property to LoggingEvent 2022-09-30 00:27:49 +08:00
Zachary Haber
b139aafcab
feat: setParseCallStackFunction(undefined) will restore the default behavior 2022-09-29 23:27:49 +08:00
Zachary Haber
d53495a8ab
fix: setParseCallStackFunction will no longer allow invalid values
if set to an invalid value, it'll throw an error immediately, instead of later.
2022-09-29 23:27:49 +08:00
Zachary Haber
a17c8e5e6f
feat: allow setting how deeply a logger should search into the stack
`logger.callStackLinesToSkip = 2` will make it skip 2 extra lines above the base.

You can't skip negative lines

Refs: #1268
2022-09-29 23:27:48 +08:00
Zachary Haber
89b8a58f3f
feat: use data Error for callStack information
use the first data value if an Error to get callstack info. Only 1 line will be stripped from it by default

Refs: #1268
2022-09-29 23:27:47 +08:00
Lam Wei Li
2523e17a15
chore(deps-dev): bump prettier from 1.19.1 to 2.7.1 2022-09-28 17:22:38 +08:00
Lam Wei Li
c7b3814f0d
docs: updated documentation 2022-09-03 17:13:49 +08:00
Lam Wei Li
a8418a0c85
refactor(#1082): removed return value for log4js.shutdown() 2022-09-03 17:13:48 +08:00
Lam Wei Li
49e301df80
Merge branch 'master' into shutdown-type-consistent 2022-09-03 00:04:24 +08:00
Lam Wei Li
462e35a1fb
refactor(#1316): code flow and readability (%C:class, %M:function, %A:alias, %F:full - in order) 2022-09-01 21:54:54 +08:00
Pawel Soltys
397b06e15f FEAT: documentation for %F field 2022-09-01 12:48:10 +02:00
Pawel Soltys
03b3f50870 FEAT: added %F field containing fully qualified caller name 2022-08-29 15:11:04 +02:00
Pawel Soltys
396a4de469 FEAT: patternLayout function name, class name and function alias
Added to patternLayout the following fields:

- %M - function name of the caller issuing the logging request
- %C - class name of the caller issuing the logging request
- %A - function alias of the caller issuing the logging request

The first two come from log4j, and use the same field specifiers.

When called from method bar of a Class foo:

- %M will be replaced with bar
- %C will be replaced with Foo
- %A will be empty

When called from function foo:

- %M will be replaced with foo
- %C will be empty
- %A will be empty

%A will be non empty only if the call stack parsed to obtain the values
contains string [as foo].
2022-08-27 22:00:53 +02:00
Lam Wei Li
4bc5589a28
style: ran prettier 2022-07-26 03:07:06 +08:00
Eugene YOBOUE
04cbdfe6ab fix: update connect-logger.js #1284 2022-07-08 21:32:11 +08:00
Lam Wei Li
6acc345b59
Merge pull request #1279 from eyoboue/nolog-function
feat: adding function(req, res) support to connectLogger options->nol…
2022-07-04 15:46:27 +08:00
Eugene YOBOUE
3279647175 chore(feat): Update #1279 docs 2022-07-03 19:47:47 +00:00
Lam Wei Li
60c9e53da0
fix: load CJS appenders for ESM projects 2022-07-04 01:26:32 +08:00
Eugene YOBOUE
9f18c6d6b9 feat: adding function(req, res) support to connectLogger options->nolog arg 2022-07-03 13:32:41 +00:00
Zachary Haber
cad9555948
style: run prettier:fix 2022-06-23 01:00:07 +08:00
Lam Wei Li
e378b597a6
style: prepare for prettier:fix 2022-06-23 01:00:00 +08:00
Lam Wei Li
e6eee6d2cf
refactor: clearer logic for invalid level and LOG synonym 2022-05-29 12:06:04 +08:00
Lam Wei Li
d718d84359
fix: fs.appendFileSync should use flag instead of flags 2022-05-23 14:22:34 +08:00
Lam Wei Li
2825f7c9e4
feat: logger.log() to be synonym of logger.info() 2022-05-22 18:08:37 +08:00
Lam Wei Li
a0eceefed1
feat: tilde expansion for filename 2022-05-22 16:40:06 +08:00
Lam Wei Li
d182204079
fix: filename validation (cannot be directory) 2022-05-22 16:23:48 +08:00
Lam Wei Li
6de1da298e
refactor: code flow and readability 2022-05-22 16:18:13 +08:00
Lam Wei Li
505204addc
style: white-space 2022-05-22 16:18:10 +08:00
Lam Wei Li
70dc7b8736
fix: fallback for logger.log outputs nothing 2022-05-20 01:09:24 +08:00