Add different and extendable logging transports
See original GitHub issueIt would be nice if Logdown could write to log files.
The atma-logger for example is able to write to the filesystem or to a remote server (via HTTP): https://github.com/atmajs/atma-logger#transports
There is also winston, a multi-transport async logging library. With winston
logging transports can be changed the following way:
winston = require('winston');
winston.add(winston.transports.File, {
filename: config.logging_file,
handleExceptions: true,
})
.remove(winston.transports.Console)
.info('Name', 'Message');
Would be great to have something similar with Logdown. 😃
Issue Analytics
- State:
- Created 7 years ago
- Comments:29 (14 by maintainers)
Top Results From Across the Web
Winston Logging - separate levels to separate Transports
You can create a custom transport and log only the levels you want. Here is an example just to give you an idea:...
Read more >Node Logging Basics - The Ultimate Guide To Logging - Loggly
Use multiple transports of the same type; Add custom transports; Stream logs; Query logs; Profiling; Handle uncaught exceptions; Use one of a range...
Read more >electron-log/extend.md at master - GitHub
It returns a message data property with some transformations applied. Example of adding a custom transform function. log.transports.file.
Read more >tslog - Extensible TypeScript Logger for Node.js and Browser ...
Every incoming log message runs through a number of steps before being displayed or handed over to a "transport". Every step can be...
Read more >winston - npm
A transport is essentially a storage device for your logs. Each instance of a winston logger can have multiple transports configured at ...
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 Free
Top 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
I like the idea a lot.
I would make as simple as possible, using an array that is a collection of functions that will be called on every
logdown
method.My proposal for the API:
Don’t think we should provide any custom transport function, since they are super easy to implement.
The reasoning for not adding babel is the same for TypeScript: bundle size This is a small lib, don’t think we would benefit a lot using Babel.