Shared Transports
See original GitHub issueI am having trouble setting up shared transports.
I am using this method to add the shared transports:
winston.loggers.add('some-category', {
transports: [
// Setup your shared transports here
]
});
Basically, I have two types of loggers one “debugLogger”, and then a large number of “specificDebugLoggers”. I want the specific debug loggers to each get their own file, but I also want them to log output to the main debug file.
However, when I try and share the transports, I get this error:
Error: Transport already attached: file
Here is what I am doing:
debugFileTransport = {
filename: '/var/log/mycoolapp/debug.log',
};
// Here is how the main debug log is created.
winston.loggers.add('debugLogger', {
transports: [
new winston.transports.File(debugFileTransport) // Here is the shared transport
]
});
// And here is how the specific debug logs get created.
createLogger = function(name, filepath) {
winston.loggers.add(name, {
transports: [
new winston.transports.File(debugFileTransport), // Here is the shared transport
new winston.transports.File({
filename: filepath,
})
]
});
return winston.loggers.get(name);
};
Issue Analytics
- State:
- Created 12 years ago
- Comments:25 (8 by maintainers)
Top Results From Across the Web
Shared transport - Wikipedia
Shared transport or shared mobility is a transportation system where travelers share a vehicle either simultaneously as a group (e.g. ride-sharing) or over ......
Read more >What Is Shared Mobility? - Shared-Use Mobility Center
We broadly define shared mobility as transportation services and resources that are shared among users, either concurrently or one after another.
Read more >What does shared transport mean? - Definitions.net
Shared transport is a term for describing a demand-driven vehicle-sharing arrangement, in which travelers share a vehicle either simultaneously as a group ...
Read more >Integration of shared transport at a public transport stop: mode ...
Two studies regarding bicycle sharing in the Netherlands showed that shared bicycles are often used as a substitute for the bus, tram, metro,...
Read more >Shared Transport Definition: 113 Samples | Law Insider
Shared Transport is defined as local interoffice transmission facilities shared by more than one Carrier, including Qwest, between End Office Switches, ...
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
@ash211 @gdbtek or anyone who see this thread, You should set
name
field in the option. It’s being used to detect duplicate transports.Hi, I have followed along with the docs and these past issues. I no longer receive the original issues but I am only getting output to one file :