diff --git a/lib/appenders/index.js b/lib/appenders/index.js index efe23981..f5956b39 100644 --- a/lib/appenders/index.js +++ b/lib/appenders/index.js @@ -68,9 +68,17 @@ const createAppender = (name, config) => { `appender "${name}" is not valid (type "${appenderConfig.type}" could not be found)` ); if (appenderModule.appender) { + process.emitWarning( + `Appender ${appenderConfig.type} exports an appender function.`, + "DeprecationWarning", "log4js-node-DEP0001" + ); debug(`DEPRECATION: Appender ${appenderConfig.type} exports an appender function.`); } if (appenderModule.shutdown) { + process.emitWarning( + `Appender ${appenderConfig.type} exports a shutdown function.`, + "DeprecationWarning", "log4js-node-DEP0002" + ); debug(`DEPRECATION: Appender ${appenderConfig.type} exports a shutdown function.`); } diff --git a/lib/layouts.js b/lib/layouts.js index 76231faf..dad27972 100644 --- a/lib/layouts.js +++ b/lib/layouts.js @@ -155,6 +155,11 @@ function patternLayout(pattern, tokens) { format = dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT; break; case 'ABSOLUTE': + process.emitWarning( + "Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. " + + "Please use %d{ABSOLUTETIME} instead.", + "DeprecationWarning", "log4js-node-DEP0003" + ); debug("DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}."); // falls through case 'ABSOLUTETIME': @@ -162,6 +167,11 @@ function patternLayout(pattern, tokens) { format = dateFormat.ABSOLUTETIME_FORMAT; break; case 'DATE': + process.emitWarning( + "Pattern %d{DATE} is deprecated due to the confusion it causes when used. " + + "Please use %d{DATETIME} instead.", + "DeprecationWarning", "log4js-node-DEP0004" + ); debug("DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}."); // falls through case 'DATETIME':