flatiron.js

Multiple log files with Winston?

ぐ巨炮叔叔 提交于 2019-12-17 23:11:43
问题 We'd like to use Winston for our logging in Node.js. But, we can't figure out how to have two log files: one for just errors, and one for everything else. Doing this the naive way doesn't work, however: adding multiple winston.transports.File transports gives an error. Others have run into this problem, with vague hints of a solution, but no real answer. Any ideas? 回答1: I just sent a pull request that allows using multiple File transports in one logger. https://github.com/flatiron/winston

flatiron.js/plates partial templates?

[亡魂溺海] 提交于 2019-12-04 17:56:26
问题 So, I just started working with flatironjs and "plates". I'm trying to figure out how I can have a main layout template and then a partial template that loads content into the main layout template similar to how expressjs does it... With expressjs there's the layout.js and perhaps index.js. index.js populates the content area of layout.js. It seems like this would be baked I'm not seeing a way to do this based on the documentation. 回答1: Main layout template (template.html): <h1>This is the

flatiron.js/plates partial templates?

人盡茶涼 提交于 2019-12-03 11:48:37
So, I just started working with flatironjs and " plates ". I'm trying to figure out how I can have a main layout template and then a partial template that loads content into the main layout template similar to how expressjs does it... With expressjs there's the layout.js and perhaps index.js. index.js populates the content area of layout.js. It seems like this would be baked I'm not seeing a way to do this based on the documentation. Main layout template (template.html): <h1>This is the main template.</h1> <div id="main"></div> Partial (partial.html): <p>This is the partial that should be

Multiple log files with Winston?

浪子不回头ぞ 提交于 2019-11-28 20:39:20
We'd like to use Winston for our logging in Node.js. But, we can't figure out how to have two log files: one for just errors, and one for everything else. Doing this the naive way doesn't work, however: adding multiple winston.transports.File transports gives an error. Others have run into this problem, with vague hints of a solution, but no real answer . Any ideas? pesho I just sent a pull request that allows using multiple File transports in one logger. https://github.com/flatiron/winston/pull/149 It is already merged into flatiron/winston. You can also use my forked repo: https://github.com

Winston: how to rotate logs

无人久伴 提交于 2019-11-28 18:11:54
How can I rotate logs when using Winston to handle logging for node.js. That is, how can I create a new file for each day the app runs? var logger = new (winston.Logger)({ transports: [ new (winston.transports.Console)(), new (winston.transports.File)({ filename: '2012-07-09.log' }) ] }); logger.log('info', 'Test Log Message', { anything: 'This is metadata' }); winston author and maintainer here. Logging to a new file everyday is currently an open feature request: https://github.com/flatiron/winston/issues/10 . Would love to see someone implement it. That said, there are other options: The

Winston: how to rotate logs

£可爱£侵袭症+ 提交于 2019-11-27 11:06:44
问题 How can I rotate logs when using Winston to handle logging for node.js. That is, how can I create a new file for each day the app runs? var logger = new (winston.Logger)({ transports: [ new (winston.transports.Console)(), new (winston.transports.File)({ filename: '2012-07-09.log' }) ] }); logger.log('info', 'Test Log Message', { anything: 'This is metadata' }); 回答1: winston author and maintainer here. Logging to a new file everyday is currently an open feature request: https://github.com