- [#1803], [#1807] Fix TypeScript bugs.
- [#1740] Add space between
info.message
andmeta.message
. - [#1813] Avoid indirect storage-engine dependency.
- [#1810] README updates.
- [#1779] Fix property name in rejection handler.
- [#1768] Exclude extraneous files from NPM package.
- [#1364], [#1714] Don't remove transport from logger when transport error occurs.
- [#1603] Expose
child
property on default logger. - [#1777] Allow HTTP transport to pass options to request.
- [#1662] Add bearer auth capabilities to HTTP transport.
- [#1612] Remove no-op in file transport.
- [#1622], [#1623], [#1625] Typescript fixes.
- (Minor) [#1647], [#1793] Update CI settings.
- (Minor) [#1600], [#1605], [#1593], [#1610], [#1654], [#1656], [#1661], [#1651], [#1652], [#1677], [#1683], [#1684], [#1700], [#1697], [#1650], [#1705], [#1723], [#1737], [#1733], [#1743], [#1750], [#1754], [#1780], [#1778] README, Transports.md, other docs changes.
- [#1672], [#1686], [#1772] Update dependencies.
- #[1579], (@indexzero) Fallback to the "root" instance always created by
createLogger
for level convenience methods (e.g..info()
,.silly()
). (Fixes [#1577]). - [#1539], (@indexzero) Assume message is the empty string when level-helper methods are invoked with no arguments (Fixed [#1501]).
- [#1583], (@kibertoad) Add typings for defaultMeta (Fixes [#1582])
- [#1586], (@kibertoad) Update dependencies.
NOTE: this was our first release using Github Projects. See the 3.2.0 Release Project.
- [#1471], (@kibertoad) Implement child loggers.
- [#1462], (@drazisil) Add handleRejection support.
- [#1555], (@DABH) Add fixes from [#1355] to unhandled rejection handler.
- [#1418], (@mfrisbey) Precompile ES6 syntax before publishing to npm.
- [#1533], (@kibertoad) Update to Babel 7.
- [#1562], (@indexzero) [fix] Better handling of
new Error(string)
throughout the pipeline(s). (Fixes [#1338], [#1486]).
- [#1355], (@DABH) Fix issues with ExceptionHandler (Fixes [#1289]).
- [#1463], (@SerayaEryn) Bubble transport
warn
events up to logger in addition toerror
s. - [#1480], [#1503], (@SerayaEryn) File tailrolling fix.
- [#1483], (@soldair) Assign log levels to un-bound functions.
- [#1513], (@TilaTheHun0) Set maxListeners for Console transport.
- [#1521], (@jamesbechet) Fix Transform from
readable-stream
using CRA. - [#1434], (@Kouzukii) Fixes logger.query function (regression from
3.0.0
) - [#1526], (@pixtron) Log file without .gz for tailable (Fixes [#1525]).
- [#1559], (@eubnara) Fix typo related to
exitOnError
. - [#1556], (@adoyle-h) Support to create log directory if it doesn't exist for FileTransport.
- [#1552], (@indexzero) Consistent handling of meta with (and without)
interpolation in
winston
andlogform
. - [#1499], (@DABH) Provide all of
SPLAT
to formats (Fixes [#1485]). - [#1485], (@mpabst) Fixing off-by-one when using both meta and splat.
Previously splat
would have added a meta
property for any additional
info[SPLAT]
beyond the expected number of tokens.
As of [email protected]
, format.splat
assumes additional splat paramters
(aka "metas") are objects and merges enumerable properties into the info
.
e.g. BE ADVISED previous "metas" that were not objects will very likely
lead to odd behavior. e.g.
const { createLogger, format, transports } = require('winston');
const { splat } = format;
const { MESSAGE, LEVEL, SPLAT } = require('triple-beam');
const logger = createLogger({
format: format.combine(
format.splat(),
format.json()
),
transports: [new transports.Console()]
});
// Expects two tokens, but four splat parameters provided.
logger.info(
'Let us %s for %j', // message
'objects', // used for %s
{ label: 'sure' }, // used for %j
'lol', ['ok', 'why'] // Multiple additional meta values
);
// winston < 3.2.0 && [email protected] behavior:
// Added "meta" property.
//
// { level: 'info',
// message: 'Let us objects for {"label":"sure"}',
// meta: ['lol', ['ok', 'why']],
// [Symbol(level)]: 'info',
// [Symbol(message)]: 'Let us %s for %j',
// [Symbol(splat)]: [ 'objects', { label: 'sure' } ] }
// winston >= 3.2.0 && [email protected] behavior: Enumerable properties
// assigned into `info`. Since **strings and Arrays only have NUMERIC
// enumerable properties we get this behavior!**
//
// { '0': 'ok',
// '1': 'why',
// '2': 'l',
// level: 'info',
// message: 'Let us objects for {"label":"sure"}',
// [Symbol(level)]: 'info',
// [Symbol(message)]: 'Let us %s for %j',
// [Symbol(splat)]: [ 'objects', { label: 'sure' } ] }
- Documentation Updates
- [#1410], (@hakanostrom) Add docs reference to transport for Cloudant.
- [#1467], (@SeryaEryn) Add fast-file-rotate transport to transport.md.
- [#1488], (@adamcohen) Fix multi logger documentation.
- [#1531], (@mapleeit) Add links to transports.
- [#1548], (@ejmartin504) Fix
README.md
for awaiting logs. - [#1554], (@indexzero) Document the solution to [#1486] as by design.
- Other small improvements: [#1509].
- Improved TypeScript support
- [#1470], (@jd-carroll) Export all transport options (Fixes [#1469]).
- [#1474], (@jd-carroll) Correct import to avoid conflict (Fixed [#1472]).
- [#1546], (@alewiahmed) Add consoleWarnLevels field to the
ConsoleTransportOptions
interface type definition. - [#1557], (@negezor) Add missing
child()
method.
- Dependency management
- [#1560], (@kibertoad) Update dependencies.
- [#1512], (@SerayaEryn) Add node@11 and disallow failures on node@10.
- [#1516], (@SerayaEryn) Update
readable-stream
tov3.0.6
. - [#1534], (@kibertoad) Update
@types/node
,nyc
, andthrough2
.
- Minor TypeScript fixes [#1362], [#1395], [#1440]
- Fix minor typos [#1359], [#1363], [#1372], [#1378], [#1390]
- [#1373], (@revik): Add
consoleWarnLevels
property to console transport options forconsole.warn
browser support. - [#1394], (@bzoz): Fix tests on Windows.
- [#1447], (@dboshardy): Support transport name option to override default names for built-in transports.
- [#1420], (@ledbit): Fix file rotation with
tailing: true
(Fixes [#1450], [#1194]). - [#1352], (@lutovich): Add
isLevelEnabled(string)
&isXXXEnabled()
toLogger
class. - Dependency management
- Regenerate
package-lock.json
. - Upgrade to
colors@^1.3.2
(Fixes [#1439]). - Upgrade to
logform@^1.9.1
. - Upgrade to
diagnostics@^1.1.1
. - Upgrade to
@types/node@^10.9.3
. - Upgrade to
assume@^2.1.0
. - Upgrade to
hock@^1.3.3
. - Upgrade to
mocha@^5.2.0
. - Upgrade to
nyc@^13.0.1
. - Upgrade to
split2@^3.0.0
.
- Regenerate
- [#1332], (@DABH): logger.debug is sent to stderr (Fixed [#1024])
- [#1328], (@ChrisAlderson): Logger level doesn't update transports level (Fixes [#1191]).
- [#1356], (@indexzero) Move splat functionality into logform. (Fixes [#1298]).
- [#1340], (@indexzero): Check log.length when evaluating "legacyness" of transports (Fixes [#1280]).
- [#1346], (@indexzero): Implement
_final
from Node.js streams. (Related to winston-transport#24, Fixes [#1250]). - [#1347], (@indexzero): Wrap calls to
format.transform
with try / catch (Fixes [#1261]). - [#1357], (@indexzero): Remove paddings as we have no use for it in the current API.
- [TODO]: REMAINS OPEN, NO PR (Fixes [#1289])
- Documentation
- [#1301], (@westonpace) Cleaned up some of the documentation on
colorize
to address concerns in [#1095]. - First pass at a heavy refactor of
docs/transports.md
.
- [#1301], (@westonpace) Cleaned up some of the documentation on
- Dependency management
- Regenerate
package-lock.json
. - Upgrade to
logform@^1.9.0
.
- Regenerate
- Document that we are pushing for a June 5th, 2018 release of
[email protected]
- [#1287], (@DABH) Added types for Typescript.
- [#1335] Typescript: silent is boolean.
- [#1323] Add level method to default logger.
- [#1286], (@ChrisAlderson) Migrate codebase to ES6
- [#1324], (@ChrisAlderson) Fix regression introduced by ES6 migration for exception handling.
- [#1333], (@ChrisAlderson) Fix removing all loggers from a container.
- [#1291], [#1294], [#1318], (@indexzero, @ChrisAlderson, @mempf) Improvements
to
File
transport core functionality. Fixes [#1194]. - [#1311], (@ChrisAlderson) Add
eol
option toStream
transport. - [#1297], (@ChrisAlderson) Move
winston.config
totriple-beam
. Expose for backwards compatibility. - [#1320], (@ChrisAlderson) Enhance tests to run on Windows.
- Internal project maintenance
- Bump to
[email protected]
which may cause incompatibilities if your custom transport does not explicitly requirewinston-transport
itself. - [#1292], (@ChrisAlderson) Add node v10 to TravisCI build matrix.
- [#1296], (@indexzero) Improve
UPGRADE-3.0.md
. Add Github Issue Template. - Remove "npm run report" in favor of reports being automatically generate.
- Update
logform
,triple-beam
, andwinston-transport
to latest.
- Bump to
Special thanks to our newest
winston
core team member – @ChrisAlderson for helping make[email protected]
a reality next week!
- [#1281] Use
Buffer.alloc
andBuffer.from
instead ofnew Buffer
. - Better browser support
- [#1142] Move common tailFile to a separate file
- [#1279] Use feature detection to be safer for browser usage.
- MOAR Docs!
- Document that we are pushing for a May 29th, 2018 release of
[email protected]
- Add David Hyde as official contributor.
- [#1278] Final Draft of Upgrade Guide in
UPGRADE-3.0.md
- Merge Roadmap from
3.0.0.md
intoCONTRIBUTING.md
and other improvements toCONTRIBUTING.md
- Document that we are pushing for a May 29th, 2018 release of
- Improve & expand examples
- [#1175] Add more copy about printf formats based on issue feedback.
- [#1134] Add sampleto document timestamps more clearly as an example.
- [#1273] Add example using multiple formats.
- [#1250] Add an example illustrating the "finish" event for AWS Lambda scenarios.
- Use simple format to better show that
humanReadableUnhandledException
is now the default message format. - Add example to illustrate that example code from winston-transport
README.md
is correct.
- Update
devDependencies
- Bump
assume
to^2.0.1
. - Bump
winston-compat
to^0.1.1
.
- Bump
- (@indexzero, @dabh) Add support for
{ silent }
option to
require('winston').Logger;
require('winston-transport').TransportStream;
- Better browser support
- [#1145], (@Jasu) Replace
isstream
withis-stream
to make stream detection work in browser. - [#1146], (@Jasu) Rename query to different than function name, to support Babel 6.26.
- [#1145], (@Jasu) Replace
- Better Typescript support in all supporting libraries
- Update documentation
- (@indexzero) Correct link to upgrade guide. Fixes #1255.
- [#1258], (@morenoh149) Document how to colorize levels. Fixes #1135.
- [#1246], (@KlemenPlazar) Update colors argument when adding custom colors
- Update
CONTRIBUTING.md
- [#1239], (@dabh) Add changelog entries for
v3.0.0-rc3
- Add example showing that
{ level }
can be deleted from info objects becauseSymbol.for('level')
is whatwinston
uses internally. Fixes #1184.
- [#1195], (@Nilegfx) Fix type error when creating
new stream.Stream()
- [#1109], (@vsetka) Fix file transprot bug where
self.filename
was not being updated onENOENT
- [#1153], (@wizardnet972) Make prototype methods return like the original method
- [#1234], (@guiguan, @indexzero) Add tests for properly handling logging of
undefined
,null
andError
values - [#1235], (@indexzero) Add example demonstrating how
meta
objects BECOME theinfo
object - Minor fixes to docs & examples: [#1232], [#1185]
- [#1209], (@dabh) Use new version of colors, solving a number of issues.
- [#1197], (@indexzero) Roadmap & guidelines for contributors.
- [#1100] Require the package.json by its full name.
- [#1149] Updates
async
to latest (2.6.0
) - [#1228], (@mcollina) Always pass a function to
fs.close
. - Minor fixes to docs & examples: [#1177], [#1182], [#1208], [#1198], [#1165], [#1110], [#1117], [#1097], [#1155], [#1084], [#1141], [#1210], [#1223].
- Fix file transport improper binding of
_onDrain
and_onError
#1104
See UPGRADE-3.0.md for a complete & living upgrade guide.
See 3.0.0.md for a list of remaining RC tasks.
- Rewrite of core logging internals:
Logger
&Transport
are now implemented using Node.jsobjectMode
streams. - Your transports should not break: Special attention has been given to ensure backwards compatibility with existing transports. You will likely see this:
YourTransport is a legacy winston transport. Consider upgrading to winston@3:
- Upgrade docs: https://github.com/winstonjs/winston/tree/master/UPGRADE.md
filters
,rewriters
, andcommon.log
are now formats:winston.format
offers a simple mechanism for user-land formatting & style features. The organic & frankly messy growth ofcommon.log
is of the past; these feature requests can be implemented entirely outside ofwinston
itself.
const { createLogger, format, transports } = require('winston');
const { combine, timestamp, label, printf } = format;
const myFormat = printf(info => {
return `${info.timestamp} [${info.label}] ${info.level}: ${info.message}`;
});
const logger = createLogger({
combine(
label({ label: 'right meow!' }),
timestamp(),
myFormat
),
transports: [new transports.Console()]
});
- Increased modularity: several subsystems are now stand-alone packages:
- [logform] exposed as
winston.format
- [winston-transport] exposed as
winston.Transport
- [abstract-winston-transport] used for reusable unit test suites for transport authors.
- [logform] exposed as
2.x
branch will get little to no maintenance: no feature requests will be accepted – only a limited number of open PRs will be merged. Hoping the [significant performance benefits][perf-bench] incentivizes folks to upgrade quickly. Don't agree? Say something!- No guaranteed support for
node@4
or below: all code will be migrated to ES6 over time. This release was started when ES5 was still a hard requirement due to the current LTS needs.
ZOMFG [email protected] EDITION
- [#1036] Container.add() 'filters' and 'rewriters' option passing to logger.
- [#1066] Fixed working of "humanReadableUnhandledException" parameter when additional data is added in meta.
- [#1040] Added filtering by log level
- [#1042] Fix regressions brought by
2.3.1
.- Fix regression on array printing.
- Fix regression on falsy value.
- [#977] Always decycle objects before cloning.
- Fixes [#862]
- Fixes [#474]
- Fixes [#914]
- [57af38a] Missing context in
.lazyDrain
ofFile
transport. - [178935f] Suppress excessive Node warning from
fs.unlink
. - [fcf04e1] Add
label
option toFile
transport docs. - [7e736b4], [24300e2] Added more info about undocumented
winston.startTimer()
method. - [#1076], [#1082], [#1029], [#989], [e1e7188] Minor grammatical & style updates to
README.md
.
- #868, Fix 'Maximum call stack size exceeded' error with custom formatter.
- Full
CHANGELOG.md
entry forthcoming. See thegit
diff for2.3.0
for now.
- Full
CHANGELOG.md
entry forthcoming. See thegit
diff for2.2.0
for now.
- #751, Fix colors not appearing in non-tty environments. Fixes #609, #616, #669, #648 (
fiznool
). - #752 Correct syslog RFC number. 5424 instead of 524. (
jbenoit2011
)
Most important
- 0f82204 Move
winston.transports.DailyRotateFile
into a separate module:require('winston-daily-rotate-file');
- fb9eec0 Reverse log levels in
npm
andcli
configs to conform to RFC524. Fixes #424 #406 #290 - 8cd8368 Change the method signature to a
filter
function to be consistent withrewriter
and log functions:
function filter (level, msg, meta, inst) {
// Filter logic goes here...
}
Other breaking changes
- e0c9dde Remove
winston.transports.Webhook
. Usewinston.transports.Http
instead. - f71e638 Remove
Logger.prototype.addRewriter
andLogger.prototype.addFilter
since they just push to an Array of functions. Uselogger.filters.push
orlogger.rewriters.push
explicitly instead. - a470ab5 No longer respect the
handleExceptions
option tonew winston.Logger
. Instead just pass in theexceptionHandlers
option itself. - 8cb7048 Removed
Logger.prototype.extend
functionality
- 3aa990c Added
Logger.prototype.configure
which now contains all logic previously in thewinston.Logger
constructor function. (indexzero
) - #726 Update .npmignore (
coreybutler
) - #700 Add an
eol
option to theConsole
transport. (aquavitae
) - #731 Update
lib/transports.js
for better static analysis. (indexzero
)
- #632 Allow
File
transport to be anobjectMode
writable stream. (stambata
) - #527, 163f4f9, 3747ccf Performance optimizations and string interpolation edge cases (
indexzero
) - f0edafd Code cleanup for reability, ad-hoc styleguide enforcement (
indexzero
)
- 727 Fix "raw" mode (
jcrugzz
) - 703 Do not modify Error or Date objects when logging. Fixes #610 (
harriha
).
- #721 Fixed octal literal to work with node 4 strict mode (
wesleyeff
) - #630 Add stderrLevels option to Console Transport and update docs (
paulhroth
) - #626 Add the logger (this) in the fourth argument in the rewriters and filters functions (
christophehurpeau
) - #623 Fix Console Transport's align option tests (
paulhroth
,kikobeats
) - #692 Adding winston-aws-cloudwatch to transport docs (
timdp
)
- de80160 Add Gitter badge (
The Gitter Badger
) - 44564de [fix] Correct listeners in
logException
. Fixes #218 #213 #327. (indexzero
) - 45b1eeb [fix] Get
tailFile
function working on latest/all node versions (Christopher Jeffrey
) - c6d45f9 Fixed event subscription on close (
Roman Stetsyshin
)
- TravisCI updates & best practices 87b97cc 91a5bc4, cf24e6a (
indexzero
) - d5397e7 Bump async version (
Roderick Hsiao
) - Documentation updates & fixes 86d7527, 38254c1, 04e2928, 61c8a89, c42a783, 0688a22, eabc113 c9506b7, 17534d2, b575e7b (
Stefan Thies
,charukiewicz
,unLucio
,Adam Cohen
,Denis Gorbachev
,Frederik Ring
,Luigi Pinca
,jeffreypriebe
) - Documentation refactor & cleanup a19607e, d1932b4, 7a13132 (
indexzero
)
- #639 Fix for #213: More than 10 containers triggers EventEmitter memory leak warning (
marcus
) - Documentation and
package.json
updates cec892c, 2f13b4f, b246efd, 22a5f5a, 5868b78, 99b6b44, 447a813, 7f75b48 (peteward44
,Gilad Peleg
,Anton Ian Sipos
,nimrod-becker
,LarsTi
,indexzero
)
- #587 Do not extend
String
prototypes as a side effect of usingcolors
. (kenperkins
) - #581 File transports now emit
error
on error of the underlying streams aftermaxRetries
attempts. (ambbell
). - #583, 92729a Use
os.EOL
for all file writing by default. (Mik13
,indexzero
) - #532 Delete logger instance from
Container
whenclose
event is emitted. (snater
) - #380 Rename
duration
todurationMs
, which is now a number a not a string ending inms
. (neoziro
) - #253 Do not set a default level. When
level
is falsey on anyTransport
instance, anyLogger
instance uses the configured level (instead of the Transport level) (jstamerj
).
- b83de62 Fix rendering of stack traces.
- c899cc Update documentation (Fixes #549)
- #551 Filter metadata along with messages
- #578 Fixes minor issue with
maxFiles
inFile
transport (Fixes #556). - #560 Added
showLevel
support toFile
transport. - #558 Added
showLevel
support toConsole
transport.
- #496 Updated default option handling for CLI (
oojacoboo
). - f37634b [dist] Only support
node >= 0.8.0
. (indexzero
) - 91a1e90, 50163a0 Fix #84 Enable a better unhandled exception experience (
samz
) - 8b5fbcd #448 Added tailable option to file transport which rolls files backwards instead of creating incrementing appends. Implements #268 (
neouser99
) - a34f7d2 Custom log formatter functionality were added. (
Melnyk Andii
) - 4c08191 Added showLevel flag to common.js, file*, memory and console transports. (
Tony Germaneri
) - 64ed8e0 Adding custom pretty print function test. (
Alberto Pose
) - 3872dfb Adding prettyPrint parameter as function example. (
Alberto Pose
) - 2b96eee implemented filters #526 (
Chris Oloff
) - 72273b1 Added the options to colorize only the level, only the message or all. Default behavior is kept. Using true will only colorize the level and false will not colorize anything. (
Michiel De Mey
) - 178e8a6 Prevent message from meta input being overwritten (
Leonard Martin
) - 270be86 [api] Allow for transports to be removed by their string name [test fix] Add test coverage for multiple transports of the same type added in #187. [doc] Document using multiple transports of the same type (
indexzero
) - 0a848fa Add depth options for meta pretty print (
Loïc Mahieu
) - 106b670 Allow debug messages to be sent to stdout (
John Frizelle
) - ad2d5e1 [fix] Handle Error instances in a sane way since their properties are non-enumerable by default. Fixes #280. (
indexzero
) - 5109dd0 [fix] Have a default
until
before a defaultfrom
. Fixes #478. (indexzero
) - d761960 Fix logging regular expression objects (
Chasen Le Hara
) - 2632eb8 Add option for EOL chars on FileTransport (
José F. Romaniello
) - bdecce7 Remove duplicate logstash option (
José F. Romaniello
) - 7a01f9a Update declaration block according to project's style guide (
Ricardo Torres
) - ae27a19 Fixes #306: Can't set customlevels to my loggers (RangeError: Maximum call stack size exceeded) (
Alberto Pose
) - 1ba4f51 [fix] Call
res.resume()
in HttpTransport to get around known issues in streams2. (indexzero
) - 39e0258 Updated default option handling for CLI (
Jacob Thomason
) - 8252801 Added logstash support to console transport (
Ramon Snir
) - 18aa301 Module isStream should be isstream (
Michael Neil
) - 2f5f296 options.prettyPrint can now be a function (
Matt Zukowski
) - a87a876 Adding rotationFormat prop to file.js (
orcaman
) - ff187f4 Allow custom exception level (
jupiter
)
- Full fix for #296 with proper streams2 detection with
isstream
for file transport (jcrugzz
) - Add isstream module (
jcrugzz
) - Partially fix #296 with streams2 detection for file transport (
indexzero
) - add stress test for issue #288 (
indexzero
) - lessen timeouts to check test sanity (
indexzero
) - update winston-graylog2 documentation (
unlucio
) - fix test formatting (
indexzero
) - fix so options are not redefined (
indexzero
) - fix self/this issue that broke
http
transport (indexzero
)
- Add label option for DailyRotateFile transport (
francoisTemasys
) - fix Logger#transports length check upon Logger#log (
adriano-di-giovanni
,indexzero
) - err can be a string. (
gdw2
,indexzero
) - Added color for pre-defined cli set. (
danilo1105
,indexzero
) - Fix dates on transport test (
revington
) - Included the label from options to the output in JSON mode. (
arxony
) - Allow using logstash option with the File transport (
gmajoulet
) - Be more defensive when working with
query
methods from Transports. Fixes #356. (indexzero) - Catch exceptions for file transport unlinkSync (
calvinfo
) - Adding the 'addRewriter' to winston (
machadogj
) - Updates to transport documentation (
pose
) - fix typo in "Extending another object with Logging" section.
- Updated README.md - Replaced properties with those listed in winston-mongodb module
- Fixes for HTTP Transport
- Removing jsonquest and request dependencies.
- Configuration is now shalow cloned.
- Added logstash support
- Fix for "flush" event should always fire after "flush" call bug
- Added tests for file: open and stress.
- Test fixes
- Fix ")" on string interpolation
## 0.6.2 / 2012-07-08
- Added prettyPrint option for console logging
- Multi-line values for conditional returns are not allowed
- Added acceptance of
stringify
option - Fixed padding for log levels