3.0.0-rc1 - Unable to log timestamps
See original GitHub issueI followed the example from the documentation, and created a logger as shown below:
const { createLogger, format, transports } = require('winston');
const logger = createLogger(
{
level: 'info',
transports: [new transports.Console({
showLevel: false,
colorize: true,
timestamp: true
})
]
}
);
logger.info('Server started');
But, I can seem to get the time stamps working. I get the following output in black and white:
{“message”:“Server started”,“level”:“info”}
Based on the documentation at https://github.com/winstonjs/winston/blob/master/docs/transports.md#console-transport, setting timestamp flag to true should put a default timestamp.
I even tried by returning a custom timestamp by passing a function but even that doesn’t show up. Perhaps, I missed something but it seems like none of the options work, ie. colorize, showLevel, timestamp.
Or is the documentation out of sync?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:16
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Node.js - How to add timestamp to logs using Winston library?
In case you are trying to add timestamp to your logs using the latest version of Winston - 3.0.0-rc1, ... There are two...
Read more >How do I resolve the error "Bad request timestamp" when ...
Log in to the Duo Admin Panel and see if you can find the failed authentication attempt in the Authentication Logs. If you...
Read more >Release Notes for Zabbix 3.0.0rc1
This document contains the release notes for Zabbix 3.0.0rc1. ... ZBX-10102, Added support for log file meta information update for items ...
Read more >Version history - FileZilla
SFTP: Fixed error handling if reading from child process fails ... MSW: Toggling the log timestamp option no longer results in wrong log...
Read more >PutLogEvents - Amazon CloudWatch Logs
Uploads a batch of log events to the specified log stream. ... The log events in the batch must be in chronological order...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@armadillojim
Use the
printf
format like this:why
format.timestamp
does not work withoutformat.json
being declared afterformat.timestamp
?