zeddemore-logger 2.3.1 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ZeddemoreLogger.js +13 -8
- package/lib/defaults.js +3 -3
- package/package.json +5 -1
package/lib/ZeddemoreLogger.js
CHANGED
|
@@ -750,8 +750,10 @@ class ZeddemoreLogger extends ZeddemoreBase {
|
|
|
750
750
|
/**
|
|
751
751
|
* Log server listening information
|
|
752
752
|
* @param {Object} options
|
|
753
|
+
* @param {String} [options.address]
|
|
753
754
|
* @param {String} [options.environment]
|
|
754
|
-
* @param {String} [options.
|
|
755
|
+
* @param {String} [options.family]
|
|
756
|
+
* @param {String} [options.listenHost] - @deprecated Use options.address instead
|
|
755
757
|
* @param {String} [options.instance]
|
|
756
758
|
* @param {String} [options.name]
|
|
757
759
|
* @param {number} [options.port]
|
|
@@ -760,20 +762,23 @@ class ZeddemoreLogger extends ZeddemoreBase {
|
|
|
760
762
|
*/
|
|
761
763
|
#logServerListening = (options, logLevel = wll.INFO) => {
|
|
762
764
|
const serverEnvironment = options.environment || this.serverEnvironment;
|
|
763
|
-
const
|
|
765
|
+
const serverAddress = options.address || options.listenHost || defaults.address;
|
|
766
|
+
let serverFamily = options.family || null;
|
|
764
767
|
const serverInstance = options.instance || this.serverInstance;
|
|
765
768
|
const serverName = options.name || this.serverName;
|
|
766
769
|
const serverPort = options.port || this.serverPort;
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
+
if (_.isNull(serverFamily)) {
|
|
771
|
+
const usingIPv4 = true;
|
|
772
|
+
const usingIPv6 = _.isString(serverAddress) && serverAddress.includes(defaults.addressIPv6Sentinel);
|
|
773
|
+
serverFamily = _.compact([ (usingIPv4 ? 'IPv4' : null), (usingIPv6 ? chalk.red('IPv6') : null) ]).join('/');
|
|
774
|
+
}
|
|
770
775
|
const msgParts = [ ];
|
|
771
776
|
const serverParts = [ serverName ];
|
|
772
777
|
if (serverEnvironment) serverParts.push(serverEnvironment);
|
|
773
778
|
if (serverInstance) serverParts.push(serverInstance);
|
|
774
779
|
msgParts.push(`[${ serverParts.join(':') }]`);
|
|
775
|
-
msgParts.push(`Node.js server listening on ${
|
|
776
|
-
msgParts.push(`(${
|
|
780
|
+
msgParts.push(`Node.js server listening on ${ serverAddress }:${ chalk.bold(serverPort) }`);
|
|
781
|
+
msgParts.push(`(${ serverFamily })`);
|
|
777
782
|
this.log(logLevel)(msgParts.join(' '));
|
|
778
783
|
}
|
|
779
784
|
|
|
@@ -867,7 +872,7 @@ class ZeddemoreLogger extends ZeddemoreBase {
|
|
|
867
872
|
* @param {String} [options.morganFormat]
|
|
868
873
|
* @returns {function(*, *, *): void}
|
|
869
874
|
*/
|
|
870
|
-
morganMiddleware = (options) => {
|
|
875
|
+
morganMiddleware = (options = { }) => {
|
|
871
876
|
options = options || { };
|
|
872
877
|
const colorize = _.isBoolean(options.colorize) ? options.colorize : this.colorize;
|
|
873
878
|
const disableMorganLogging = _.isBoolean(options.disableMorganLogging) ? options.disableMorganLogging : !this.httpRequestLogging;
|
package/lib/defaults.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright (c) 2024-
|
|
1
|
+
// Copyright (c) 2024-2026 by Beardon Services, Inc.
|
|
2
2
|
|
|
3
3
|
const enums = require('./enums');
|
|
4
4
|
|
|
@@ -6,14 +6,14 @@ const { hexColors: hc, logLevelTypes: llt, morganFormats: mf, morganFormatTokens
|
|
|
6
6
|
winstonLogLevelNames: wlln, winstonTransports: wt } = enums;
|
|
7
7
|
|
|
8
8
|
module.exports = {
|
|
9
|
+
address: '::',
|
|
10
|
+
addressIPv6Sentinel: ':',
|
|
9
11
|
colorConsoleWhiteHex: hc.CONSOLE_WHITE,
|
|
10
12
|
consoleDirExtensionMethodName: 'dirp',
|
|
11
13
|
consoleDirExtensionColors: true,
|
|
12
14
|
consoleDirExtensionDepth: null,
|
|
13
15
|
consoleDirExtensionShowHidden: true,
|
|
14
16
|
contentLengthDigits: 2,
|
|
15
|
-
listenHost: '::',
|
|
16
|
-
listenHostIPv6Sentinel: ':',
|
|
17
17
|
liveMessage: 'live',
|
|
18
18
|
logLevelType: llt.CONSOLE,
|
|
19
19
|
morganFormat: mf.ZEDDEMORE,
|
package/package.json
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zeddemore-logger",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "Node.js logger using Morgan and Winston for thread and caller info tracking",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/beardon/zeddemore-logger.git"
|
|
8
8
|
},
|
|
9
9
|
"keywords": [
|
|
10
|
+
"email",
|
|
10
11
|
"express",
|
|
12
|
+
"ldap",
|
|
11
13
|
"logger",
|
|
12
14
|
"morgan",
|
|
15
|
+
"nodejs",
|
|
16
|
+
"nodemailer",
|
|
13
17
|
"winston"
|
|
14
18
|
],
|
|
15
19
|
"author": "Aaron Bean <aaron.bean@beardon.com> (https://beardon.com)",
|