repo_name
stringclasses
28 values
pr_number
int64
8
3.71k
pr_title
stringlengths
3
107
pr_description
stringlengths
0
60.1k
author
stringlengths
4
19
date_created
timestamp[ns, tz=UTC]
date_merged
timestamp[ns, tz=UTC]
previous_commit
stringlengths
40
40
pr_commit
stringlengths
40
40
query
stringlengths
5
60.1k
filepath
stringlengths
7
167
before_content
stringlengths
0
103M
after_content
stringlengths
0
103M
label
int64
-1
1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./docs/layouts.md
# Layouts Layouts are functions used by appenders to format log events for output. They take a log event as an argument and return a string. Log4js comes with several appenders built-in, and provides ways to create your own if these are not suitable. For most use cases you will not need to configure layouts - there a...
# Layouts Layouts are functions used by appenders to format log events for output. They take a log event as an argument and return a string. Log4js comes with several appenders built-in, and provides ways to create your own if these are not suitable. For most use cases you will not need to configure layouts - there a...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./lib/appenders/multiprocess.js
const debug = require('debug')('log4js:multiprocess'); const net = require('net'); const LoggingEvent = require('../LoggingEvent'); const END_MSG = '__LOG4JS__'; /** * Creates a server, listening on config.loggerPort, config.loggerHost. * Output goes to config.actualAppender (config.appender is used to * set up th...
const debug = require('debug')('log4js:multiprocess'); const net = require('net'); const LoggingEvent = require('../LoggingEvent'); const END_MSG = '__LOG4JS__'; /** * Creates a server, listening on config.loggerPort, config.loggerHost. * Output goes to config.actualAppender (config.appender is used to * set up th...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./test/tap/newLevel-test.js
const { test } = require('tap'); const log4js = require('../../lib/log4js'); const recording = require('../../lib/appenders/recording'); test('../../lib/logger', (batch) => { batch.beforeEach((done) => { recording.reset(); if (typeof done === 'function') { done(); } }); batch.test('creating a ...
const { test } = require('tap'); const log4js = require('../../lib/log4js'); const recording = require('../../lib/appenders/recording'); test('../../lib/logger', (batch) => { batch.beforeEach((done) => { recording.reset(); if (typeof done === 'function') { done(); } }); batch.test('creating a ...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./docs/writing-appenders.md
# Writing Appenders for Log4js Log4js can load appenders from outside its core set. To add a custom appender, the easiest way is to make it a stand-alone module and publish to npm. You can also load appenders from your own application, but they must be defined in a module. ## Loading mechanism When log4js parses you...
# Writing Appenders for Log4js Log4js can load appenders from outside its core set. To add a custom appender, the easiest way is to make it a stand-alone module and publish to npm. You can also load appenders from your own application, but they must be defined in a module. ## Loading mechanism When log4js parses you...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./examples/example.js
'use strict'; const log4js = require('../lib/log4js'); // log the cheese logger messages to a file, and the console ones as well. log4js.configure({ appenders: { cheeseLogs: { type: 'file', filename: 'cheese.log' }, console: { type: 'console' }, }, categories: { cheese: { appenders: ['cheeseLogs'], l...
'use strict'; const log4js = require('../lib/log4js'); // log the cheese logger messages to a file, and the console ones as well. log4js.configure({ appenders: { cheeseLogs: { type: 'file', filename: 'cheese.log' }, console: { type: 'console' }, }, categories: { cheese: { appenders: ['cheeseLogs'], l...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./lib/appenders/stdout.js
function stdoutAppender(layout, timezoneOffset) { return (loggingEvent) => { process.stdout.write(`${layout(loggingEvent, timezoneOffset)}\n`); }; } function configure(config, layouts) { let layout = layouts.colouredLayout; if (config.layout) { layout = layouts.layout(config.layout.type, config.layout)...
function stdoutAppender(layout, timezoneOffset) { return (loggingEvent) => { process.stdout.write(`${layout(loggingEvent, timezoneOffset)}\n`); }; } function configure(config, layouts) { let layout = layouts.colouredLayout; if (config.layout) { layout = layouts.layout(config.layout.type, config.layout)...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./examples/logstashUDP.js
const log4js = require('../lib/log4js'); /* Sample logstash config: udp { codec => json port => 10001 queue_size => 2 workers => 2 type => myAppType } */ log4js.configure({ appenders: { console: { type: 'console', }, logstash: { host: '127.0.0.1', port: 10001,...
const log4js = require('../lib/log4js'); /* Sample logstash config: udp { codec => json port => 10001 queue_size => 2 workers => 2 type => myAppType } */ log4js.configure({ appenders: { console: { type: 'console', }, logstash: { host: '127.0.0.1', port: 10001,...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./docs/tcp.md
# TCP Appender The TCP appender sends log events to a master server over TCP sockets. It can be used as a simple way to centralise logging when you have multiple servers or processes. It uses the node.js core networking modules, and so does not require any extra dependencies. Remember to call `log4js.shutdown` when yo...
# TCP Appender The TCP appender sends log events to a master server over TCP sockets. It can be used as a simple way to centralise logging when you have multiple servers or processes. It uses the node.js core networking modules, and so does not require any extra dependencies. Remember to call `log4js.shutdown` when yo...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./docs/terms.md
## Terminology `Level` - a log level is the severity or priority of a log event (debug, info, etc). Whether an _appender_ will see the event or not is determined by the _category_'s level. If this is less than or equal to the event's level, it will be sent to the category's appender(s). `Category` - a label for group...
## Terminology `Level` - a log level is the severity or priority of a log event (debug, info, etc). Whether an _appender_ will see the event or not is determined by the _category_'s level. If this is less than or equal to the event's level, it will be sent to the category's appender(s). `Category` - a label for group...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./test/tap/disable-cluster-test.js
const { test } = require('tap'); const cluster = require('cluster'); const log4js = require('../../lib/log4js'); const recorder = require('../../lib/appenders/recording'); cluster.removeAllListeners(); log4js.configure({ appenders: { vcr: { type: 'recording' }, }, categories: { default: { appenders: ['vcr']...
const { test } = require('tap'); const cluster = require('cluster'); const log4js = require('../../lib/log4js'); const recorder = require('../../lib/appenders/recording'); cluster.removeAllListeners(); log4js.configure({ appenders: { vcr: { type: 'recording' }, }, categories: { default: { appenders: ['vcr']...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./test/tap/multi-file-appender-test.js
const process = require('process'); const { test } = require('tap'); const debug = require('debug'); const fs = require('fs'); const sandbox = require('@log4js-node/sandboxed-module'); const log4js = require('../../lib/log4js'); const osDelay = process.platform === 'win32' ? 400 : 200; const removeFiles = async (file...
const process = require('process'); const { test } = require('tap'); const debug = require('debug'); const fs = require('fs'); const sandbox = require('@log4js-node/sandboxed-module'); const log4js = require('../../lib/log4js'); const osDelay = process.platform === 'win32' ? 400 : 200; const removeFiles = async (file...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./test/tap/noLogFilter-test.js
const { test } = require('tap'); const log4js = require('../../lib/log4js'); const recording = require('../../lib/appenders/recording'); /** * test a simple regexp */ test('log4js noLogFilter', (batch) => { batch.beforeEach((done) => { recording.reset(); if (typeof done === 'function') { done(); ...
const { test } = require('tap'); const log4js = require('../../lib/log4js'); const recording = require('../../lib/appenders/recording'); /** * test a simple regexp */ test('log4js noLogFilter', (batch) => { batch.beforeEach((done) => { recording.reset(); if (typeof done === 'function') { done(); ...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./examples/loggly-appender.js
// Note that loggly appender needs node-loggly to work. // If you haven't got node-loggly installed, you'll get cryptic // "cannot find module" errors when using the loggly appender const log4js = require('../lib/log4js'); log4js.configure({ appenders: { console: { type: 'console', }, loggly: { ...
// Note that loggly appender needs node-loggly to work. // If you haven't got node-loggly installed, you'll get cryptic // "cannot find module" errors when using the loggly appender const log4js = require('../lib/log4js'); log4js.configure({ appenders: { console: { type: 'console', }, loggly: { ...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./docs/_config.yml
theme: jekyll-theme-minimal repository: nomiddlename/log4js-node
theme: jekyll-theme-minimal repository: nomiddlename/log4js-node
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./test/tap/configuration-validation-test.js
const { test } = require('tap'); const util = require('util'); const path = require('path'); const sandbox = require('@log4js-node/sandboxed-module'); const debug = require('debug')('log4js:test.configuration-validation'); const deepFreeze = require('deep-freeze'); const fs = require('fs'); const log4js = require('../....
const { test } = require('tap'); const util = require('util'); const path = require('path'); const sandbox = require('@log4js-node/sandboxed-module'); const debug = require('debug')('log4js:test.configuration-validation'); const deepFreeze = require('deep-freeze'); const fs = require('fs'); const log4js = require('../....
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./test/tap/dateFileAppender-test.js
/* eslint max-classes-per-file: ["error", 3] */ const { test } = require('tap'); const path = require('path'); const fs = require('fs'); const EOL = require('os').EOL || '\n'; const format = require('date-format'); const sandbox = require('@log4js-node/sandboxed-module'); const log4js = require('../../lib/log4js'); c...
/* eslint max-classes-per-file: ["error", 3] */ const { test } = require('tap'); const path = require('path'); const fs = require('fs'); const EOL = require('os').EOL || '\n'; const format = require('date-format'); const sandbox = require('@log4js-node/sandboxed-module'); const log4js = require('../../lib/log4js'); c...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./test/tap/no-cluster-test.js
const { test } = require('tap'); const proxyquire = require('proxyquire'); test('clustering is disabled if cluster is not present', (t) => { const log4js = proxyquire('../../lib/log4js', { cluster: null }); const recorder = require('../../lib/appenders/recording'); log4js.configure({ appenders: { vcr: { type...
const { test } = require('tap'); const proxyquire = require('proxyquire'); test('clustering is disabled if cluster is not present', (t) => { const log4js = proxyquire('../../lib/log4js', { cluster: null }); const recorder = require('../../lib/appenders/recording'); log4js.configure({ appenders: { vcr: { type...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./lib/appenders/categoryFilter.js
const debug = require('debug')('log4js:categoryFilter'); function categoryFilter(excludes, appender) { if (typeof excludes === 'string') excludes = [excludes]; return (logEvent) => { debug(`Checking ${logEvent.categoryName} against ${excludes}`); if (excludes.indexOf(logEvent.categoryName) === -1) { ...
const debug = require('debug')('log4js:categoryFilter'); function categoryFilter(excludes, appender) { if (typeof excludes === 'string') excludes = [excludes]; return (logEvent) => { debug(`Checking ${logEvent.categoryName} against ${excludes}`); if (excludes.indexOf(logEvent.categoryName) === -1) { ...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./examples/memory-test.js
const log4js = require('../lib/log4js'); log4js.configure({ appenders: { logs: { type: 'file', filename: 'memory-test.log', }, console: { type: 'stdout', }, file: { type: 'file', filename: 'memory-usage.log', layout: { type: 'messagePassThrough', ...
const log4js = require('../lib/log4js'); log4js.configure({ appenders: { logs: { type: 'file', filename: 'memory-test.log', }, console: { type: 'stdout', }, file: { type: 'file', filename: 'memory-usage.log', layout: { type: 'messagePassThrough', ...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./examples/pm2.json
{ "apps": [ { "name": "testing", "script": "pm2.js", "instances": 0, "instance_var": "INSTANCE_ID", "exec_mode": "cluster" } ] }
{ "apps": [ { "name": "testing", "script": "pm2.js", "instances": 0, "instance_var": "INSTANCE_ID", "exec_mode": "cluster" } ] }
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./docs/stdout.md
# Standard Output Appender This appender writes all log events to the standard output stream. It is the default appender for log4js. # Configuration - `type` - `stdout` - `layout` - `object` (optional, defaults to colouredLayout) - see [layouts](layouts.md) # Example ```javascript log4js.configure({ appenders: {...
# Standard Output Appender This appender writes all log events to the standard output stream. It is the default appender for log4js. # Configuration - `type` - `stdout` - `layout` - `object` (optional, defaults to colouredLayout) - see [layouts](layouts.md) # Example ```javascript log4js.configure({ appenders: {...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./docs/console.md
# Console Appender This appender uses node's console object to write log events. It can also be used in the browser, if you're using browserify or something similar. Be aware that writing a high volume of output to the console can make your application use a lot of memory. If you experience this problem, try switching...
# Console Appender This appender uses node's console object to write log events. It can also be used in the browser, if you're using browserify or something similar. Be aware that writing a high volume of output to the console can make your application use a lot of memory. If you experience this problem, try switching...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./lib/LoggingEvent.js
/* eslint max-classes-per-file: ["error", 2] */ /* eslint no-underscore-dangle: ["error", { "allow": ["_getLocationKeys"] }] */ const flatted = require('flatted'); const levels = require('./levels'); class SerDe { constructor() { const deserialise = { __LOG4JS_undefined__: undefined, __LOG4JS_NaN__:...
/* eslint max-classes-per-file: ["error", 2] */ /* eslint no-underscore-dangle: ["error", { "allow": ["_getLocationKeys"] }] */ const flatted = require('flatted'); const levels = require('./levels'); class SerDe { constructor() { const deserialise = { __LOG4JS_undefined__: undefined, __LOG4JS_NaN__:...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./examples/smtp-appender.js
// Note that smtp appender needs nodemailer to work. // If you haven't got nodemailer installed, you'll get cryptic // "cannot find module" errors when using the smtp appender const log4js = require('../lib/log4js'); log4js.configure({ appenders: { out: { type: 'console', }, mail: { type: '@l...
// Note that smtp appender needs nodemailer to work. // If you haven't got nodemailer installed, you'll get cryptic // "cannot find module" errors when using the smtp appender const log4js = require('../lib/log4js'); log4js.configure({ appenders: { out: { type: 'console', }, mail: { type: '@l...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./test/tap/appender-dependencies-test.js
const { test } = require('tap'); const categories = { default: { appenders: ['filtered'], level: 'debug' }, }; let log4js; let recording; test('log4js appender dependencies', (batch) => { batch.beforeEach((done) => { log4js = require('../../lib/log4js'); recording = require('../../lib/appenders/recording...
const { test } = require('tap'); const categories = { default: { appenders: ['filtered'], level: 'debug' }, }; let log4js; let recording; test('log4js appender dependencies', (batch) => { batch.beforeEach((done) => { log4js = require('../../lib/log4js'); recording = require('../../lib/appenders/recording...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./SECURITY.md
# Security Policy ## Supported Versions We're aiming to only support the latest major version of log4js. Older than that is usually _very_ old. | Version | Supported | | ------- | ------------------ | | 6.x | :white_check_mark: | | < 6.0 | :x: | ## Reporting a Vulnerability Report vul...
# Security Policy ## Supported Versions We're aiming to only support the latest major version of log4js. Older than that is usually _very_ old. | Version | Supported | | ------- | ------------------ | | 6.x | :white_check_mark: | | < 6.0 | :x: | ## Reporting a Vulnerability Report vul...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./lib/appenders/logLevelFilter.js
function logLevelFilter(minLevelString, maxLevelString, appender, levels) { const minLevel = levels.getLevel(minLevelString); const maxLevel = levels.getLevel(maxLevelString, levels.FATAL); return (logEvent) => { const eventLevel = logEvent.level; if ( minLevel.isLessThanOrEqualTo(eventLevel) && ...
function logLevelFilter(minLevelString, maxLevelString, appender, levels) { const minLevel = levels.getLevel(minLevelString); const maxLevel = levels.getLevel(maxLevelString, levels.FATAL); return (logEvent) => { const eventLevel = logEvent.level; if ( minLevel.isLessThanOrEqualTo(eventLevel) && ...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./lib/appenders/tcp-server.js
const debug = require('debug')('log4js:tcp-server'); const net = require('net'); const clustering = require('../clustering'); const LoggingEvent = require('../LoggingEvent'); const DELIMITER = '__LOG4JS__'; exports.configure = (config) => { debug('configure called with ', config); const server = net.createServer...
const debug = require('debug')('log4js:tcp-server'); const net = require('net'); const clustering = require('../clustering'); const LoggingEvent = require('../LoggingEvent'); const DELIMITER = '__LOG4JS__'; exports.configure = (config) => { debug('configure called with ', config); const server = net.createServer...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./lib/appenders/adapters.js
function maxFileSizeUnitTransform(maxLogSize) { if (typeof maxLogSize === 'number' && Number.isInteger(maxLogSize)) { return maxLogSize; } const units = { K: 1024, M: 1024 * 1024, G: 1024 * 1024 * 1024, }; const validUnit = Object.keys(units); const unit = maxLogSize.slice(-1).toLocaleUpper...
function maxFileSizeUnitTransform(maxLogSize) { if (typeof maxLogSize === 'number' && Number.isInteger(maxLogSize)) { return maxLogSize; } const units = { K: 1024, M: 1024 * 1024, G: 1024 * 1024 * 1024, }; const validUnit = Object.keys(units); const unit = maxLogSize.slice(-1).toLocaleUpper...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./lib/appenders/noLogFilter.js
const debug = require('debug')('log4js:noLogFilter'); /** * The function removes empty or null regexp from the array * @param {string[]} regexp * @returns {string[]} a filtered string array with not empty or null regexp */ function removeNullOrEmptyRegexp(regexp) { const filtered = regexp.filter((el) => el != nu...
const debug = require('debug')('log4js:noLogFilter'); /** * The function removes empty or null regexp from the array * @param {string[]} regexp * @returns {string[]} a filtered string array with not empty or null regexp */ function removeNullOrEmptyRegexp(regexp) { const filtered = regexp.filter((el) => el != nu...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./lib/categories.js
const debug = require('debug')('log4js:categories'); const configuration = require('./configuration'); const levels = require('./levels'); const appenders = require('./appenders'); const categories = new Map(); /** * Add inherited config to this category. That includes extra appenders from parent, * and level, if ...
const debug = require('debug')('log4js:categories'); const configuration = require('./configuration'); const levels = require('./levels'); const appenders = require('./appenders'); const categories = new Map(); /** * Add inherited config to this category. That includes extra appenders from parent, * and level, if ...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./examples/hipchat-appender.js
/** * !!! The hipchat-appender requires `hipchat-notifier` from npm, e.g. * - list as a dependency in your application's package.json || * - npm install hipchat-notifier */ const log4js = require('../lib/log4js'); log4js.configure({ appenders: { hipchat: { type: 'hipchat', hipchat_token: ...
/** * !!! The hipchat-appender requires `hipchat-notifier` from npm, e.g. * - list as a dependency in your application's package.json || * - npm install hipchat-notifier */ const log4js = require('../lib/log4js'); log4js.configure({ appenders: { hipchat: { type: 'hipchat', hipchat_token: ...
-1
log4js-node/log4js-node
1,334
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately
lamweili
2022-10-01T18:55:40Z
2022-10-01T18:57:33Z
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
7ca308dfde78ffc3ece68b77e30107590c61dc12
feat(log4js): if cb is passed to `shutdown()`, it must be a function or it will throw error immediately.
./.github/workflows/npm-publish.yml
# This workflow will run tests using node and then publish a package to GitHub Packages when a milestone is closed # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages name: Node.js Package on: milestone: types: [closed] jobs: build: runs-on...
# This workflow will run tests using node and then publish a package to GitHub Packages when a milestone is closed # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages name: Node.js Package on: milestone: types: [closed] jobs: build: runs-on...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./lib/LoggingEvent.js
/* eslint max-classes-per-file: ["error", 2] */ const flatted = require('flatted'); const levels = require('./levels'); class SerDe { constructor() { const deserialise = { __LOG4JS_undefined__: undefined, __LOG4JS_NaN__: Number('abc'), __LOG4JS_Infinity__: 1 / 0, '__LOG4JS_-Infinity__': ...
/* eslint max-classes-per-file: ["error", 2] */ /* eslint no-underscore-dangle: ["error", { "allow": ["_getLocationKeys"] }] */ const flatted = require('flatted'); const levels = require('./levels'); class SerDe { constructor() { const deserialise = { __LOG4JS_undefined__: undefined, __LOG4JS_NaN__:...
1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./test/tap/LoggingEvent-test.js
const flatted = require('flatted'); const { test } = require('tap'); const LoggingEvent = require('../../lib/LoggingEvent'); const levels = require('../../lib/levels'); test('LoggingEvent', (batch) => { batch.test('should serialise to flatted', (t) => { const event = new LoggingEvent( 'cheese', level...
const flatted = require('flatted'); const { test } = require('tap'); const LoggingEvent = require('../../lib/LoggingEvent'); const levels = require('../../lib/levels'); test('LoggingEvent', (batch) => { batch.test('should throw error for invalid location', (t) => { t.throws( () => new LoggingEvent(...
1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./test/tap/logger-test.js
const { test } = require('tap'); const debug = require('debug')('log4js:test.logger'); const sandbox = require('@log4js-node/sandboxed-module'); const callsites = require('callsites'); const levels = require('../../lib/levels'); const categories = require('../../lib/categories'); /** @type {import('../../types/log4js'...
const { test } = require('tap'); const debug = require('debug')('log4js:test.logger'); const sandbox = require('@log4js-node/sandboxed-module'); const callsites = require('callsites'); const levels = require('../../lib/levels'); const categories = require('../../lib/categories'); /** @type {import('../../types/log4js'...
1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./test/tap/connect-logger-test.js
/* eslint max-classes-per-file: ["error", 2] */ const { test } = require('tap'); const EE = require('events').EventEmitter; const levels = require('../../lib/levels'); class MockLogger { constructor() { this.level = levels.TRACE; this.messages = []; this.log = function (level, message) { this.mess...
/* eslint max-classes-per-file: ["error", 2] */ const { test } = require('tap'); const EE = require('events').EventEmitter; const levels = require('../../lib/levels'); class MockLogger { constructor() { this.level = levels.TRACE; this.messages = []; this.log = function (level, message) { this.mess...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./lib/appenders/categoryFilter.js
const debug = require('debug')('log4js:categoryFilter'); function categoryFilter(excludes, appender) { if (typeof excludes === 'string') excludes = [excludes]; return (logEvent) => { debug(`Checking ${logEvent.categoryName} against ${excludes}`); if (excludes.indexOf(logEvent.categoryName) === -1) { ...
const debug = require('debug')('log4js:categoryFilter'); function categoryFilter(excludes, appender) { if (typeof excludes === 'string') excludes = [excludes]; return (logEvent) => { debug(`Checking ${logEvent.categoryName} against ${excludes}`); if (excludes.indexOf(logEvent.categoryName) === -1) { ...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./test/tap/configuration-inheritance-test.js
const { test } = require('tap'); const log4js = require('../../lib/log4js'); const categories = require('../../lib/categories'); test('log4js category inherit all appenders from direct parent', (batch) => { batch.test('should inherit appenders from direct parent', (t) => { const config = { appenders: { ...
const { test } = require('tap'); const log4js = require('../../lib/log4js'); const categories = require('../../lib/categories'); test('log4js category inherit all appenders from direct parent', (batch) => { batch.test('should inherit appenders from direct parent', (t) => { const config = { appenders: { ...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./examples/smtp-appender.js
// Note that smtp appender needs nodemailer to work. // If you haven't got nodemailer installed, you'll get cryptic // "cannot find module" errors when using the smtp appender const log4js = require('../lib/log4js'); log4js.configure({ appenders: { out: { type: 'console', }, mail: { type: '@l...
// Note that smtp appender needs nodemailer to work. // If you haven't got nodemailer installed, you'll get cryptic // "cannot find module" errors when using the smtp appender const log4js = require('../lib/log4js'); log4js.configure({ appenders: { out: { type: 'console', }, mail: { type: '@l...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./test/tap/stdoutAppender-test.js
const { test } = require('tap'); const sandbox = require('@log4js-node/sandboxed-module'); const layouts = require('../../lib/layouts'); test('stdout appender', (t) => { const output = []; const appender = sandbox .require('../../lib/appenders/stdout', { globals: { process: { stdout: {...
const { test } = require('tap'); const sandbox = require('@log4js-node/sandboxed-module'); const layouts = require('../../lib/layouts'); test('stdout appender', (t) => { const output = []; const appender = sandbox .require('../../lib/appenders/stdout', { globals: { process: { stdout: {...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./examples/stacktrace.js
const log4js = require('../lib/log4js'); log4js.configure({ appenders: { 'console-appender': { type: 'console', layout: { type: 'pattern', pattern: '%[[%p]%] - %10.-100f{2} | %7.12l:%7.12o - %[%m%]', }, }, }, categories: { default: { appenders: ['console-append...
const log4js = require('../lib/log4js'); log4js.configure({ appenders: { 'console-appender': { type: 'console', layout: { type: 'pattern', pattern: '%[[%p]%] - %10.-100f{2} | %7.12l:%7.12o - %[%m%]', }, }, }, categories: { default: { appenders: ['console-append...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./lib/appenders/multiFile.js
const debug = require('debug')('log4js:multiFile'); const path = require('path'); const fileAppender = require('./file'); const findFileKey = (property, event) => event[property] || event.context[property]; module.exports.configure = (config, layouts) => { debug('Creating a multi-file appender'); const files = ...
const debug = require('debug')('log4js:multiFile'); const path = require('path'); const fileAppender = require('./file'); const findFileKey = (property, event) => event[property] || event.context[property]; module.exports.configure = (config, layouts) => { debug('Creating a multi-file appender'); const files = ...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./test/tap/fileSyncAppender-test.js
const { test } = require('tap'); const fs = require('fs'); const path = require('path'); const EOL = require('os').EOL || '\n'; const sandbox = require('@log4js-node/sandboxed-module'); const log4js = require('../../lib/log4js'); function remove(filename) { try { fs.unlinkSync(filename); } catch (e) { // d...
const { test } = require('tap'); const fs = require('fs'); const path = require('path'); const EOL = require('os').EOL || '\n'; const sandbox = require('@log4js-node/sandboxed-module'); const log4js = require('../../lib/log4js'); function remove(filename) { try { fs.unlinkSync(filename); } catch (e) { // d...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./test/tap/consoleAppender-test.js
const { test } = require('tap'); const sandbox = require('@log4js-node/sandboxed-module'); const consoleAppender = require('../../lib/appenders/console'); test('log4js console appender', (batch) => { batch.test('should export a configure function', (t) => { t.type(consoleAppender.configure, 'function'); t.en...
const { test } = require('tap'); const sandbox = require('@log4js-node/sandboxed-module'); const consoleAppender = require('../../lib/appenders/console'); test('log4js console appender', (batch) => { batch.test('should export a configure function', (t) => { t.type(consoleAppender.configure, 'function'); t.en...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./lib/appenders/file.js
const debug = require('debug')('log4js:file'); const path = require('path'); const streams = require('streamroller'); const os = require('os'); const eol = os.EOL; let mainSighupListenerStarted = false; const sighupListeners = new Set(); function mainSighupHandler() { sighupListeners.forEach((app) => { app.sigh...
const debug = require('debug')('log4js:file'); const path = require('path'); const streams = require('streamroller'); const os = require('os'); const eol = os.EOL; let mainSighupListenerStarted = false; const sighupListeners = new Set(); function mainSighupHandler() { sighupListeners.forEach((app) => { app.sigh...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./test/tap/configuration-test.js
const { test } = require('tap'); const sandbox = require('@log4js-node/sandboxed-module'); const realFS = require('fs'); const modulePath = 'some/path/to/mylog4js.json'; const pathsChecked = []; let fakeFS = {}; let dependencies; let fileRead; test('log4js configure', (batch) => { batch.beforeEach((done) => { ...
const { test } = require('tap'); const sandbox = require('@log4js-node/sandboxed-module'); const realFS = require('fs'); const modulePath = 'some/path/to/mylog4js.json'; const pathsChecked = []; let fakeFS = {}; let dependencies; let fileRead; test('log4js configure', (batch) => { batch.beforeEach((done) => { ...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./examples/fromreadme.js
// remember to change the require to just 'log4js' if you've npm install'ed it const log4js = require('../lib/log4js'); log4js.configure({ appenders: { cheese: { type: 'file', filename: 'cheese.log' } }, categories: { default: { appenders: ['cheese'], level: 'error' } }, }); const logger = log4js.getLogger('chees...
// remember to change the require to just 'log4js' if you've npm install'ed it const log4js = require('../lib/log4js'); log4js.configure({ appenders: { cheese: { type: 'file', filename: 'cheese.log' } }, categories: { default: { appenders: ['cheese'], level: 'error' } }, }); const logger = log4js.getLogger('chees...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./lib/appenders/fileSync.js
const debug = require('debug')('log4js:fileSync'); const path = require('path'); const fs = require('fs'); const os = require('os'); const eol = os.EOL; function touchFile(file, options) { // attempt to create the directory const mkdir = (dir) => { try { return fs.mkdirSync(dir, { recursive: true }); ...
const debug = require('debug')('log4js:fileSync'); const path = require('path'); const fs = require('fs'); const os = require('os'); const eol = os.EOL; function touchFile(file, options) { // attempt to create the directory const mkdir = (dir) => { try { return fs.mkdirSync(dir, { recursive: true }); ...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./test/tap/configuration-validation-test.js
const { test } = require('tap'); const util = require('util'); const path = require('path'); const sandbox = require('@log4js-node/sandboxed-module'); const debug = require('debug')('log4js:test.configuration-validation'); const deepFreeze = require('deep-freeze'); const fs = require('fs'); const log4js = require('../....
const { test } = require('tap'); const util = require('util'); const path = require('path'); const sandbox = require('@log4js-node/sandboxed-module'); const debug = require('debug')('log4js:test.configuration-validation'); const deepFreeze = require('deep-freeze'); const fs = require('fs'); const log4js = require('../....
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./test/tap/no-cluster-test.js
const { test } = require('tap'); const proxyquire = require('proxyquire'); test('clustering is disabled if cluster is not present', (t) => { const log4js = proxyquire('../../lib/log4js', { cluster: null }); const recorder = require('../../lib/appenders/recording'); log4js.configure({ appenders: { vcr: { type...
const { test } = require('tap'); const proxyquire = require('proxyquire'); test('clustering is disabled if cluster is not present', (t) => { const log4js = proxyquire('../../lib/log4js', { cluster: null }); const recorder = require('../../lib/appenders/recording'); log4js.configure({ appenders: { vcr: { type...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./examples/patternLayout-tokens.js
const log4js = require('../lib/log4js'); log4js.configure({ appenders: { out: { type: 'console', layout: { type: 'pattern', pattern: '%[%r (%x{pid}) %p %c -%] %m%n', tokens: { pid: function () { return process.pid; }, }, }, }, ...
const log4js = require('../lib/log4js'); log4js.configure({ appenders: { out: { type: 'console', layout: { type: 'pattern', pattern: '%[%r (%x{pid}) %p %c -%] %m%n', tokens: { pid: function () { return process.pid; }, }, }, }, ...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./test/tap/noLogFilter-test.js
const { test } = require('tap'); const log4js = require('../../lib/log4js'); const recording = require('../../lib/appenders/recording'); /** * test a simple regexp */ test('log4js noLogFilter', (batch) => { batch.beforeEach((done) => { recording.reset(); if (typeof done === 'function') { done(); ...
const { test } = require('tap'); const log4js = require('../../lib/log4js'); const recording = require('../../lib/appenders/recording'); /** * test a simple regexp */ test('log4js noLogFilter', (batch) => { batch.beforeEach((done) => { recording.reset(); if (typeof done === 'function') { done(); ...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./test/tap/disable-cluster-test.js
const { test } = require('tap'); const cluster = require('cluster'); const log4js = require('../../lib/log4js'); const recorder = require('../../lib/appenders/recording'); cluster.removeAllListeners(); log4js.configure({ appenders: { vcr: { type: 'recording' }, }, categories: { default: { appenders: ['vcr']...
const { test } = require('tap'); const cluster = require('cluster'); const log4js = require('../../lib/log4js'); const recorder = require('../../lib/appenders/recording'); cluster.removeAllListeners(); log4js.configure({ appenders: { vcr: { type: 'recording' }, }, categories: { default: { appenders: ['vcr']...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./docs/writing-appenders.md
# Writing Appenders for Log4js Log4js can load appenders from outside its core set. To add a custom appender, the easiest way is to make it a stand-alone module and publish to npm. You can also load appenders from your own application, but they must be defined in a module. ## Loading mechanism When log4js parses you...
# Writing Appenders for Log4js Log4js can load appenders from outside its core set. To add a custom appender, the easiest way is to make it a stand-alone module and publish to npm. You can also load appenders from your own application, but they must be defined in a module. ## Loading mechanism When log4js parses you...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./test/tap/setLevel-asymmetry-test.js
// This test shows an asymmetry between setLevel and isLevelEnabled // (in log4js-node@0.4.3 and earlier): // 1) setLevel("foo") works, but setLevel(log4js.levels.foo) silently // does not (sets the level to TRACE). // 2) isLevelEnabled("foo") works as does isLevelEnabled(log4js.levels.foo). // const { test } = req...
// This test shows an asymmetry between setLevel and isLevelEnabled // (in log4js-node@0.4.3 and earlier): // 1) setLevel("foo") works, but setLevel(log4js.levels.foo) silently // does not (sets the level to TRACE). // 2) isLevelEnabled("foo") works as does isLevelEnabled(log4js.levels.foo). // const { test } = req...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./test/tap/levels-test.js
const { test } = require('tap'); const levels = require('../../lib/levels'); function assertThat(assert, level) { function assertForEach(assertion, testFn, otherLevels) { otherLevels.forEach((other) => { assertion.call(assert, testFn.call(level, other)); }); } return { isLessThanOrEqualTo(lvls...
const { test } = require('tap'); const levels = require('../../lib/levels'); function assertThat(assert, level) { function assertForEach(assertion, testFn, otherLevels) { otherLevels.forEach((other) => { assertion.call(assert, testFn.call(level, other)); }); } return { isLessThanOrEqualTo(lvls...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./test/tap/dateFileAppender-test.js
/* eslint max-classes-per-file: ["error", 3] */ const { test } = require('tap'); const path = require('path'); const fs = require('fs'); const EOL = require('os').EOL || '\n'; const format = require('date-format'); const sandbox = require('@log4js-node/sandboxed-module'); const log4js = require('../../lib/log4js'); c...
/* eslint max-classes-per-file: ["error", 3] */ const { test } = require('tap'); const path = require('path'); const fs = require('fs'); const EOL = require('os').EOL || '\n'; const format = require('date-format'); const sandbox = require('@log4js-node/sandboxed-module'); const log4js = require('../../lib/log4js'); c...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./CHANGELOG.md
# log4js-node Changelog ## 6.6.1 - [fix: connectlogger nolog function](https://github.com/log4js-node/log4js-node/pull/1285) - thanks [@eyoboue](https://github.com/eyoboue) - [type: corrected AppenderModule interface and Recording interface](https://github.com/log4js-node/log4js-node/pull/1304) - thanks [@lamweili](h...
# log4js-node Changelog ## 6.6.1 - [fix: connectlogger nolog function](https://github.com/log4js-node/log4js-node/pull/1285) - thanks [@eyoboue](https://github.com/eyoboue) - [type: corrected AppenderModule interface and Recording interface](https://github.com/log4js-node/log4js-node/pull/1304) - thanks [@lamweili](h...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./.prettierignore
**/.* coverage
**/.* coverage
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./examples/cluster.js
'use strict'; const cluster = require('cluster'); const log4js = require('../lib/log4js'); log4js.configure({ appenders: { out: { type: 'stdout' }, }, categories: { default: { appenders: ['out'], level: 'debug' } }, }); let logger; if (cluster.isMaster) { logger = log4js.getLogger('master'); cluster.fo...
'use strict'; const cluster = require('cluster'); const log4js = require('../lib/log4js'); log4js.configure({ appenders: { out: { type: 'stdout' }, }, categories: { default: { appenders: ['out'], level: 'debug' } }, }); let logger; if (cluster.isMaster) { logger = log4js.getLogger('master'); cluster.fo...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./docs/tcp.md
# TCP Appender The TCP appender sends log events to a master server over TCP sockets. It can be used as a simple way to centralise logging when you have multiple servers or processes. It uses the node.js core networking modules, and so does not require any extra dependencies. Remember to call `log4js.shutdown` when yo...
# TCP Appender The TCP appender sends log events to a master server over TCP sockets. It can be used as a simple way to centralise logging when you have multiple servers or processes. It uses the node.js core networking modules, and so does not require any extra dependencies. Remember to call `log4js.shutdown` when yo...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./test/tap/pause-test.js
const tap = require('tap'); const fs = require('fs'); const log4js = require('../../lib/log4js'); const removeFiles = async (filenames) => { if (!Array.isArray(filenames)) filenames = [filenames]; const promises = filenames.map((filename) => fs.promises.unlink(filename)); await Promise.allSettled(promises); }; ...
const tap = require('tap'); const fs = require('fs'); const log4js = require('../../lib/log4js'); const removeFiles = async (filenames) => { if (!Array.isArray(filenames)) filenames = [filenames]; const promises = filenames.map((filename) => fs.promises.unlink(filename)); await Promise.allSettled(promises); }; ...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./examples/example-connect-logger.js
// The connect/express logger was added to log4js by danbell. This allows connect/express servers to log using log4js. // https://github.com/nomiddlename/log4js-node/wiki/Connect-Logger // load modules const log4js = require('log4js'); const express = require('express'); const app = express(); // config log4js.confi...
// The connect/express logger was added to log4js by danbell. This allows connect/express servers to log using log4js. // https://github.com/nomiddlename/log4js-node/wiki/Connect-Logger // load modules const log4js = require('log4js'); const express = require('express'); const app = express(); // config log4js.confi...
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./types/test.ts
import * as log4js from './log4js'; log4js.configure('./filename'); const logger1 = log4js.getLogger(); logger1.level = 'debug'; logger1.debug('Some debug messages'); logger1.fatal({ whatever: 'foo', }); const logger3 = log4js.getLogger('cheese'); logger3.trace('Entering cheese testing'); logger3.debug('Got cheese....
import * as log4js from './log4js'; log4js.configure('./filename'); const logger1 = log4js.getLogger(); logger1.level = 'debug'; logger1.debug('Some debug messages'); logger1.fatal({ whatever: 'foo', }); const logger3 = log4js.getLogger('cheese'); logger3.trace('Entering cheese testing'); logger3.debug('Got cheese....
-1
log4js-node/log4js-node
1,333
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one
lamweili
2022-10-01T17:05:08Z
2022-10-01T17:20:06Z
570ef530dc02d3e843a5421cb015bb8fadfe0b41
cfbc7a08a6395a9c9bd6ceb9573a9ca786e137d7
refactor(LoggingEvent): loop through location keys instead of hard-coding one-by-one.
./examples/hipchat-appender.js
/** * !!! The hipchat-appender requires `hipchat-notifier` from npm, e.g. * - list as a dependency in your application's package.json || * - npm install hipchat-notifier */ const log4js = require('../lib/log4js'); log4js.configure({ appenders: { hipchat: { type: 'hipchat', hipchat_token: ...
/** * !!! The hipchat-appender requires `hipchat-notifier` from npm, e.g. * - list as a dependency in your application's package.json || * - npm install hipchat-notifier */ const log4js = require('../lib/log4js'); log4js.configure({ appenders: { hipchat: { type: 'hipchat', hipchat_token: ...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./lib/LoggingEvent.js
const flatted = require('flatted'); const levels = require('./levels'); /** * @name LoggingEvent * @namespace Log4js */ class LoggingEvent { /** * Models a logging event. * @constructor * @param {string} categoryName name of category * @param {Log4js.Level} level level of message * @param {Array} d...
/* eslint max-classes-per-file: ["error", 2] */ const flatted = require('flatted'); const levels = require('./levels'); class SerDe { constructor() { const deserialise = { __LOG4JS_undefined__: undefined, __LOG4JS_NaN__: Number('abc'), __LOG4JS_Infinity__: 1 / 0, '__LOG4JS_-Infinity__': ...
1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./lib/connect-logger.js
/* eslint no-underscore-dangle: ["error", { "allow": ["__statusCode", "_remoteAddress", "__headers", "_logging"] }] */ const levels = require('./levels'); const DEFAULT_FORMAT = ':remote-addr - -' + ' ":method :url HTTP/:http-version"' + ' :status :content-length ":referrer"' + ' ":user-agent"'; /** * Retur...
/* eslint no-underscore-dangle: ["error", { "allow": ["__statusCode", "_remoteAddress", "__headers", "_logging"] }] */ const levels = require('./levels'); const DEFAULT_FORMAT = ':remote-addr - -' + ' ":method :url HTTP/:http-version"' + ' :status :content-length ":referrer"' + ' ":user-agent"'; /** * Retur...
1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./lib/logger.js
/* eslint no-underscore-dangle: ["error", { "allow": ["_log"] }] */ const debug = require('debug')('log4js:logger'); const LoggingEvent = require('./LoggingEvent'); const levels = require('./levels'); const clustering = require('./clustering'); const categories = require('./categories'); const configuration = require(...
/* eslint no-underscore-dangle: ["error", { "allow": ["_log"] }] */ const debug = require('debug')('log4js:logger'); const LoggingEvent = require('./LoggingEvent'); const levels = require('./levels'); const clustering = require('./clustering'); const categories = require('./categories'); const configuration = require(...
1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./test/tap/LoggingEvent-test.js
const flatted = require('flatted'); const { test } = require('tap'); const LoggingEvent = require('../../lib/LoggingEvent'); const levels = require('../../lib/levels'); test('LoggingEvent', (batch) => { batch.test('should serialise to flatted', (t) => { const event = new LoggingEvent( 'cheese', level...
const flatted = require('flatted'); const { test } = require('tap'); const LoggingEvent = require('../../lib/LoggingEvent'); const levels = require('../../lib/levels'); test('LoggingEvent', (batch) => { batch.test('should serialise to flatted', (t) => { const event = new LoggingEvent( 'cheese', level...
1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./test/tap/logLevelFilter-test.js
const { test } = require('tap'); const fs = require('fs'); const os = require('os'); const EOL = os.EOL || '\n'; const osDelay = process.platform === 'win32' ? 400 : 200; function remove(filename) { try { fs.unlinkSync(filename); } catch (e) { // doesn't really matter if it failed } } test('log4js log...
const { test } = require('tap'); const fs = require('fs'); const os = require('os'); const EOL = os.EOL || '\n'; const osDelay = process.platform === 'win32' ? 400 : 200; function remove(filename) { try { fs.unlinkSync(filename); } catch (e) { // doesn't really matter if it failed } } test('log4js log...
1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./examples/logFaces-appender.js
const log4js = require('../lib/log4js'); /* logFaces server configured with UDP receiver, using JSON format, listening on port 55201 will receive the logs from the appender below. */ log4js.configure({ appenders: { logFaces: { type: '@log4js-node/logfaces-udp', // (mandatory) appender type app...
const log4js = require('../lib/log4js'); /* logFaces server configured with UDP receiver, using JSON format, listening on port 55201 will receive the logs from the appender below. */ log4js.configure({ appenders: { logFaces: { type: '@log4js-node/logfaces-udp', // (mandatory) appender type app...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./examples/flush-on-exit.js
/** * run this, then "ab -c 10 -n 100 localhost:4444/" to test (in * another shell) */ const log4js = require('../lib/log4js'); log4js.configure({ appenders: { cheese: { type: 'file', filename: 'cheese.log' }, }, categories: { default: { appenders: ['cheese'], level: 'debug' }, }, }); const logger ...
/** * run this, then "ab -c 10 -n 100 localhost:4444/" to test (in * another shell) */ const log4js = require('../lib/log4js'); log4js.configure({ appenders: { cheese: { type: 'file', filename: 'cheese.log' }, }, categories: { default: { appenders: ['cheese'], level: 'debug' }, }, }); const logger ...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./test/tap/server-test.js
const { test } = require('tap'); const net = require('net'); const log4js = require('../../lib/log4js'); const vcr = require('../../lib/appenders/recording'); const levels = require('../../lib/levels'); const LoggingEvent = require('../../lib/LoggingEvent'); test('TCP Server', (batch) => { batch.test( 'should li...
const { test } = require('tap'); const net = require('net'); const log4js = require('../../lib/log4js'); const vcr = require('../../lib/appenders/recording'); const levels = require('../../lib/levels'); const LoggingEvent = require('../../lib/LoggingEvent'); test('TCP Server', (batch) => { batch.test( 'should li...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./test/tap/multiprocess-shutdown-test.js
const { test } = require('tap'); const net = require('net'); const childProcess = require('child_process'); const sandbox = require('@log4js-node/sandboxed-module'); const log4js = require('../../lib/log4js'); test('multiprocess appender shutdown (master)', { timeout: 10000 }, (t) => { log4js.configure({ appende...
const { test } = require('tap'); const net = require('net'); const childProcess = require('child_process'); const sandbox = require('@log4js-node/sandboxed-module'); const log4js = require('../../lib/log4js'); test('multiprocess appender shutdown (master)', { timeout: 10000 }, (t) => { log4js.configure({ appende...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./test/tap/layouts-test.js
const { test } = require('tap'); const debug = require('debug'); const os = require('os'); const path = require('path'); const { EOL } = os; // used for patternLayout tests. function testPattern(assert, layout, event, tokens, pattern, value) { assert.equal(layout(pattern, tokens)(event), value); } test('log4js lay...
const { test } = require('tap'); const debug = require('debug'); const os = require('os'); const path = require('path'); const { EOL } = os; // used for patternLayout tests. function testPattern(assert, layout, event, tokens, pattern, value) { assert.equal(layout(pattern, tokens)(event), value); } test('log4js lay...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./test/tap/logger-test.js
const { test } = require('tap'); const debug = require('debug')('log4js:test.logger'); const sandbox = require('@log4js-node/sandboxed-module'); const callsites = require('callsites'); const levels = require('../../lib/levels'); const categories = require('../../lib/categories'); /** @type {import('../../types/log4js'...
const { test } = require('tap'); const debug = require('debug')('log4js:test.logger'); const sandbox = require('@log4js-node/sandboxed-module'); const callsites = require('callsites'); const levels = require('../../lib/levels'); const categories = require('../../lib/categories'); /** @type {import('../../types/log4js'...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./test/tap/connect-context-test.js
/* eslint max-classes-per-file: ["error", 2] */ const { test } = require('tap'); const EE = require('events').EventEmitter; const levels = require('../../lib/levels'); class MockLogger { constructor() { this.level = levels.TRACE; this.context = {}; this.contexts = []; } log() { this.contexts.pu...
/* eslint max-classes-per-file: ["error", 2] */ const { test } = require('tap'); const EE = require('events').EventEmitter; const levels = require('../../lib/levels'); class MockLogger { constructor() { this.level = levels.TRACE; this.context = {}; this.contexts = []; } log() { this.contexts.pu...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./lib/appenders/dateFile.js
const streams = require('streamroller'); const os = require('os'); const eol = os.EOL; function openTheStream(filename, pattern, options) { const stream = new streams.DateRollingFileStream(filename, pattern, options); stream.on('error', (err) => { // eslint-disable-next-line no-console console.error( ...
const streams = require('streamroller'); const os = require('os'); const eol = os.EOL; function openTheStream(filename, pattern, options) { const stream = new streams.DateRollingFileStream(filename, pattern, options); stream.on('error', (err) => { // eslint-disable-next-line no-console console.error( ...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./lib/appenders/stdout.js
function stdoutAppender(layout, timezoneOffset) { return (loggingEvent) => { process.stdout.write(`${layout(loggingEvent, timezoneOffset)}\n`); }; } function configure(config, layouts) { let layout = layouts.colouredLayout; if (config.layout) { layout = layouts.layout(config.layout.type, config.layout)...
function stdoutAppender(layout, timezoneOffset) { return (loggingEvent) => { process.stdout.write(`${layout(loggingEvent, timezoneOffset)}\n`); }; } function configure(config, layouts) { let layout = layouts.colouredLayout; if (config.layout) { layout = layouts.layout(config.layout.type, config.layout)...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./examples/log-rolling.js
const log4js = require('../lib/log4js'); log4js.configure({ appenders: { console: { type: 'console', }, file: { type: 'file', filename: 'tmp-test.log', maxLogSize: 1024, backups: 3, }, }, categories: { default: { appenders: ['console', 'file'], level: 'info' }, ...
const log4js = require('../lib/log4js'); log4js.configure({ appenders: { console: { type: 'console', }, file: { type: 'file', filename: 'tmp-test.log', maxLogSize: 1024, backups: 3, }, }, categories: { default: { appenders: ['console', 'file'], level: 'info' }, ...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./test/tap/stacktraces-test.js
const { test } = require('tap'); test('Stacktraces from errors in different VM context', (t) => { const log4js = require('../../lib/log4js'); const recorder = require('../../lib/appenders/recording'); const layout = require('../../lib/layouts').basicLayout; const vm = require('vm'); log4js.configure({ a...
const { test } = require('tap'); test('Stacktraces from errors in different VM context', (t) => { const log4js = require('../../lib/log4js'); const recorder = require('../../lib/appenders/recording'); const layout = require('../../lib/layouts').basicLayout; const vm = require('vm'); log4js.configure({ a...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./test/tap/levels-test.js
const { test } = require('tap'); const levels = require('../../lib/levels'); function assertThat(assert, level) { function assertForEach(assertion, testFn, otherLevels) { otherLevels.forEach((other) => { assertion.call(assert, testFn.call(level, other)); }); } return { isLessThanOrEqualTo(lvls...
const { test } = require('tap'); const levels = require('../../lib/levels'); function assertThat(assert, level) { function assertForEach(assertion, testFn, otherLevels) { otherLevels.forEach((other) => { assertion.call(assert, testFn.call(level, other)); }); } return { isLessThanOrEqualTo(lvls...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./test/tap/noLogFilter-test.js
const { test } = require('tap'); const log4js = require('../../lib/log4js'); const recording = require('../../lib/appenders/recording'); /** * test a simple regexp */ test('log4js noLogFilter', (batch) => { batch.beforeEach((done) => { recording.reset(); if (typeof done === 'function') { done(); ...
const { test } = require('tap'); const log4js = require('../../lib/log4js'); const recording = require('../../lib/appenders/recording'); /** * test a simple regexp */ test('log4js noLogFilter', (batch) => { batch.beforeEach((done) => { recording.reset(); if (typeof done === 'function') { done(); ...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./test/tap/file-descriptor-leak-test.js
const { test } = require('tap'); const fs = require('fs'); const path = require('path'); const log4js = require('../../lib/log4js'); const osDelay = process.platform === 'win32' ? 400 : 200; const removeFiles = async (filenames) => { if (!Array.isArray(filenames)) filenames = [filenames]; const promises = filenam...
const { test } = require('tap'); const fs = require('fs'); const path = require('path'); const log4js = require('../../lib/log4js'); const osDelay = process.platform === 'win32' ? 400 : 200; const removeFiles = async (filenames) => { if (!Array.isArray(filenames)) filenames = [filenames]; const promises = filenam...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./lib/appenders/tcp-server.js
const debug = require('debug')('log4js:tcp-server'); const net = require('net'); const clustering = require('../clustering'); const LoggingEvent = require('../LoggingEvent'); const DELIMITER = '__LOG4JS__'; exports.configure = (config) => { debug('configure called with ', config); const server = net.createServer...
const debug = require('debug')('log4js:tcp-server'); const net = require('net'); const clustering = require('../clustering'); const LoggingEvent = require('../LoggingEvent'); const DELIMITER = '__LOG4JS__'; exports.configure = (config) => { debug('configure called with ', config); const server = net.createServer...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./lib/appenders/categoryFilter.js
const debug = require('debug')('log4js:categoryFilter'); function categoryFilter(excludes, appender) { if (typeof excludes === 'string') excludes = [excludes]; return (logEvent) => { debug(`Checking ${logEvent.categoryName} against ${excludes}`); if (excludes.indexOf(logEvent.categoryName) === -1) { ...
const debug = require('debug')('log4js:categoryFilter'); function categoryFilter(excludes, appender) { if (typeof excludes === 'string') excludes = [excludes]; return (logEvent) => { debug(`Checking ${logEvent.categoryName} against ${excludes}`); if (excludes.indexOf(logEvent.categoryName) === -1) { ...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./test/tap/disable-cluster-test.js
const { test } = require('tap'); const cluster = require('cluster'); const log4js = require('../../lib/log4js'); const recorder = require('../../lib/appenders/recording'); cluster.removeAllListeners(); log4js.configure({ appenders: { vcr: { type: 'recording' }, }, categories: { default: { appenders: ['vcr']...
const { test } = require('tap'); const cluster = require('cluster'); const log4js = require('../../lib/log4js'); const recorder = require('../../lib/appenders/recording'); cluster.removeAllListeners(); log4js.configure({ appenders: { vcr: { type: 'recording' }, }, categories: { default: { appenders: ['vcr']...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./lib/categories.js
const debug = require('debug')('log4js:categories'); const configuration = require('./configuration'); const levels = require('./levels'); const appenders = require('./appenders'); const categories = new Map(); /** * Add inherited config to this category. That includes extra appenders from parent, * and level, if ...
const debug = require('debug')('log4js:categories'); const configuration = require('./configuration'); const levels = require('./levels'); const appenders = require('./appenders'); const categories = new Map(); /** * Add inherited config to this category. That includes extra appenders from parent, * and level, if ...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./lib/appenders/index.js
const path = require('path'); const debug = require('debug')('log4js:appenders'); const configuration = require('../configuration'); const clustering = require('../clustering'); const levels = require('../levels'); const layouts = require('../layouts'); const adapters = require('./adapters'); // pre-load the core appe...
const path = require('path'); const debug = require('debug')('log4js:appenders'); const configuration = require('../configuration'); const clustering = require('../clustering'); const levels = require('../levels'); const layouts = require('../layouts'); const adapters = require('./adapters'); // pre-load the core appe...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./test/tap/setLevel-asymmetry-test.js
// This test shows an asymmetry between setLevel and isLevelEnabled // (in log4js-node@0.4.3 and earlier): // 1) setLevel("foo") works, but setLevel(log4js.levels.foo) silently // does not (sets the level to TRACE). // 2) isLevelEnabled("foo") works as does isLevelEnabled(log4js.levels.foo). // const { test } = req...
// This test shows an asymmetry between setLevel and isLevelEnabled // (in log4js-node@0.4.3 and earlier): // 1) setLevel("foo") works, but setLevel(log4js.levels.foo) silently // does not (sets the level to TRACE). // 2) isLevelEnabled("foo") works as does isLevelEnabled(log4js.levels.foo). // const { test } = req...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./test/tap/pause-test.js
const tap = require('tap'); const fs = require('fs'); const log4js = require('../../lib/log4js'); const removeFiles = async (filenames) => { if (!Array.isArray(filenames)) filenames = [filenames]; const promises = filenames.map((filename) => fs.promises.unlink(filename)); await Promise.allSettled(promises); }; ...
const tap = require('tap'); const fs = require('fs'); const log4js = require('../../lib/log4js'); const removeFiles = async (filenames) => { if (!Array.isArray(filenames)) filenames = [filenames]; const promises = filenames.map((filename) => fs.promises.unlink(filename)); await Promise.allSettled(promises); }; ...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./examples/memory-test.js
const log4js = require('../lib/log4js'); log4js.configure({ appenders: { logs: { type: 'file', filename: 'memory-test.log', }, console: { type: 'stdout', }, file: { type: 'file', filename: 'memory-usage.log', layout: { type: 'messagePassThrough', ...
const log4js = require('../lib/log4js'); log4js.configure({ appenders: { logs: { type: 'file', filename: 'memory-test.log', }, console: { type: 'stdout', }, file: { type: 'file', filename: 'memory-usage.log', layout: { type: 'messagePassThrough', ...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./examples/example-connect-logger.js
// The connect/express logger was added to log4js by danbell. This allows connect/express servers to log using log4js. // https://github.com/nomiddlename/log4js-node/wiki/Connect-Logger // load modules const log4js = require('log4js'); const express = require('express'); const app = express(); // config log4js.confi...
// The connect/express logger was added to log4js by danbell. This allows connect/express servers to log using log4js. // https://github.com/nomiddlename/log4js-node/wiki/Connect-Logger // load modules const log4js = require('log4js'); const express = require('express'); const app = express(); // config log4js.confi...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./lib/layouts.js
const dateFormat = require('date-format'); const os = require('os'); const util = require('util'); const path = require('path'); const url = require('url'); const debug = require('debug')('log4js:layouts'); const styles = { // styles bold: [1, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], // ...
const dateFormat = require('date-format'); const os = require('os'); const util = require('util'); const path = require('path'); const url = require('url'); const debug = require('debug')('log4js:layouts'); const styles = { // styles bold: [1, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], // ...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./test/tap/fileAppender-test.js
/* eslint max-classes-per-file: ["error", 2] */ const { test } = require('tap'); const fs = require('fs-extra'); const path = require('path'); const sandbox = require('@log4js-node/sandboxed-module'); const zlib = require('zlib'); const util = require('util'); const osDelay = process.platform === 'win32' ? 400 : 200;...
/* eslint max-classes-per-file: ["error", 2] */ const { test } = require('tap'); const fs = require('fs-extra'); const path = require('path'); const sandbox = require('@log4js-node/sandboxed-module'); const zlib = require('zlib'); const util = require('util'); const osDelay = process.platform === 'win32' ? 400 : 200;...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./test/tap/tcp-appender-test.js
const { test } = require('tap'); const net = require('net'); const flatted = require('flatted'); const sandbox = require('@log4js-node/sandboxed-module'); const log4js = require('../../lib/log4js'); const LoggingEvent = require('../../lib/LoggingEvent'); let messages = []; let server = null; function makeServer(confi...
const { test } = require('tap'); const net = require('net'); const flatted = require('flatted'); const sandbox = require('@log4js-node/sandboxed-module'); const log4js = require('../../lib/log4js'); const LoggingEvent = require('../../lib/LoggingEvent'); let messages = []; let server = null; function makeServer(confi...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./examples/date-file-rolling.js
'use strict'; const log4js = require('../lib/log4js'); log4js.configure({ appenders: { file: { type: 'dateFile', filename: 'thing.log', numBackups: 3, pattern: '.mm', }, }, categories: { default: { appenders: ['file'], level: 'debug' }, }, }); const logger = log4js.getLogg...
'use strict'; const log4js = require('../lib/log4js'); log4js.configure({ appenders: { file: { type: 'dateFile', filename: 'thing.log', numBackups: 3, pattern: '.mm', }, }, categories: { default: { appenders: ['file'], level: 'debug' }, }, }); const logger = log4js.getLogg...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./examples/rabbitmq-appender.js
// Note that rabbitmq appender needs install amqplib to work. const log4js = require('../lib/log4js'); log4js.configure({ appenders: { out: { type: 'console', }, file: { type: 'dateFile', filename: 'logs/log.txt', pattern: 'yyyyMMdd', alwaysIncludePattern: false, }, ...
// Note that rabbitmq appender needs install amqplib to work. const log4js = require('../lib/log4js'); log4js.configure({ appenders: { out: { type: 'console', }, file: { type: 'dateFile', filename: 'logs/log.txt', pattern: 'yyyyMMdd', alwaysIncludePattern: false, }, ...
-1
log4js-node/log4js-node
1,332
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`
Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Input) | Serialised<br>(Transmission) | Deserialised<br>(Output) | Match |-|-...
lamweili
2022-10-01T10:52:35Z
2022-10-01T10:57:05Z
916eef11f1d2aa2f32765f956f1f674745feb8b6
570ef530dc02d3e843a5421cb015bb8fadfe0b41
fix(LoggingEvent): serde for `NaN`, `Infinity`, `-Infinity`, `undefined`. Fixes #1187 Supersedes PR #1188 ## Affected Components Only affects clustering, multiprocessAppender, and tcpAppender. These three will `serialise()` to `String` to transmit for the receiver to `deserialise()`. | Code | Object<br>(Inpu...
./examples/custom-layout.js
const log4js = require('../lib/log4js'); log4js.addLayout( 'json', (config) => function (logEvent) { return JSON.stringify(logEvent) + config.separator; } ); log4js.configure({ appenders: { out: { type: 'stdout', layout: { type: 'json', separator: ',' } }, }, categories: { default: { a...
const log4js = require('../lib/log4js'); log4js.addLayout( 'json', (config) => function (logEvent) { return JSON.stringify(logEvent) + config.separator; } ); log4js.configure({ appenders: { out: { type: 'stdout', layout: { type: 'json', separator: ',' } }, }, categories: { default: { a...
-1