winston.transports.DailyRotateFile is not a constructor
See original GitHub issueWhen I try the example setup, I run into an exception.
var winston = require('winston');
winston.cli();
var transport = new (winston.transports.DailyRotateFile)({
filename: 'logs/log',
datePattern: 'yyyy-MM-dd.',
prepend:true,
level: "verbose",
maxDays:0
});
winston.add(transport);
Gives me:
TypeError: winston.transports.DailyRotateFile is not a constructor at Object.<anonymous> (/home/project/Backend/node-server/logger.js:8:17) at Module._compile (module.js:570:32) at Object.Module._extensions…js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.<anonymous> (/home/project/Backend/node-server/server.js:3:14) at Module._compile (module.js:570:32)
Node Version v6.10.3 NPM Version 3.10.10 Winston 2.3.1 Winston-Daily-Rotate-File 1.7.0
Running on Ubuntu 16.04.3
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
NodeJS Logger: winston.transports.DailyRotateFile is not a ...
I'm trying to do so with winston.transports.DailyRotateFile. A piece of code below. api.use(expressWinston.logger({ transports: [ ...
Read more >winston-daily-rotate-file - npm
A transport for winston which logs to a rotating file each day.. Latest version: 4.7.1, last published: 7 months ago.
Read more >winston.transports.DailyRotateFile is not a constructor
I am not sure what I'm doing wrong here. Any help is appreciated. var winston = require('winston'); require('winston-daily-rotate-file'); ...
Read more >winston.Transports.DailyRotateFile JavaScript and Node.js ...
const File = config.rotate ? winston.transports. ... DailyRotateFile(Showing top 5 results out of 315) ... Internals/Logger.js/undefined/constructor.
Read more >Node.js Logging with Winston - Reflectoring
Winston Transports. Transports is a Winston feature that makes use of the Node.js networking, stream, and non-blocking I/O properties. Transport ...
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
Hello Does this work ?
Becasue my code is triggering the exact same issue here …
Update and if you came here from google : Solution is @ #205
I dont see
require('winston-daily-rotate-file');
What happens with: