Comments (12)
Not sure. Maybe @yosefd can answer this
from winston-mongodb.
The package options include only host and port, as it is now, so it doesn't support replica sets.
However, I am using this package to log into full sharded mongo with multiple shards and multiple replica sets. With sharded installation you have mongo router (mongos) that can be addressed like a single server.
from winston-mongodb.
+1
from winston-mongodb.
Hello all.
In regards to preveiuos questions, is it possible to specify only the master of replica set in the host configuration?
from winston-mongodb.
It is not really an option to use a mongos installation just for logging. Support for replicasets would be really useful.
from winston-mongodb.
2nd that...!
It's already half working, you can write into the DB primary, but when the Primary moves you get:
TypeError: Object Error: Cannot write to a secondary has no method 'isCompatible'
mvdwalle knows all the things...!
It would be pretty easy i think, why can't you use connection strings like mongoose...?
"uri":"db1/thing,db2/thing,db3/thing"
from winston-mongodb.
I'm getting this same error, @philpoore .
What do you mean by "when the Primary moves"?
from winston-mongodb.
Primary DB Server in the Replica Set.
If the first server in Mongo Connection String is the Primary Server it'll work.
But as soon as the set nominates a new primary. The connection to DB fails... :(
from winston-mongodb.
You can Hack Replica Sets in by changing https://github.com/indexzero/winston-mongodb/blob/master/lib/winston-mongodb.js#L76:
this.server = new mongodb.Server(this.host, this.port, {
ssl: this.ssl
});
GIVE ME 30 min i'll patch it...
from winston-mongodb.
@philpoore you may send a pull request. Note, that you should keep compatibility with old settings format and follow the same style guide. Thank you.
from winston-mongodb.
Replica Sets are supported in current version.
from winston-mongodb.
See #39
from winston-mongodb.
Related Issues (20)
- winston.transports.MongoDB pushes empty root path "/" HOT 3
- How to set the db name? HOT 6
- Stop deprecation of pre-connected DB object HOT 9
- Update repo link in npm HOT 1
- Deprecation warning { useUnifiedTopology: true } when using mongoose v>6.x HOT 5
- Authentication error when passing the database HOT 4
- Load balancer mode requires driver version 4+ HOT 14
- TypeError: value.getLowBits is not a function HOT 5
- No overload matches this call
- can you tell me how to add new property . or expireAfterSeconds HOT 2
- after pushing logs to mongoDB script keeps running and is not ending HOT 5
- winston-transport this.once in the code causes app to crash. HOT 2
- How to add custom field?
- NodeJS 20 Deprecation Warning DEP0170 HOT 11
- [Feature Request]: Make CI work HOT 6
- Ignoring level HOT 4
- [Bug]: can't format timestamp using `winston.format.timestamp` HOT 1
- [Bug]: Code snippet hangs up when logging to MongoDB. HOT 2
- [Bug]: Cannot find package "mongodb-extjson" HOT 2
- [Bug]: ObjectId in meta transformed to empty object HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from winston-mongodb.