Giter Site home page Giter Site logo

Replicaset in mongodb about winston-mongodb HOT 5 CLOSED

winstonjs avatar winstonjs commented on September 23, 2024
Replicaset in mongodb

from winston-mongodb.

Comments (5)

yurijmikhalevich avatar yurijmikhalevich commented on September 23, 2024

This dbUri should work.
Why collection name is empty?

from winston-mongodb.

geomartinez avatar geomartinez commented on September 23, 2024

Having a similar problem here... mongo installation is a replica set >> winston-mongodb able to actually create the collection but do not add any entries into collection. My file and console transports work perfectly. Below are code excerpt...
dbLogOptions.db=config.mongoURI;
//dbLogOptions.username=config.mongoUser;
//dbLogOptions.password=config.mongoPassword;
dbLogOptions.level='info';
dbLogOptions.collection='ctnLogs';
dbLogOptions.capped=true;
dbLogOptions.dbUri=config.mongoURI;

winston.add(winston.transports.MongoDB, dbLogOptions);
...
//config.json excerpt
"mongoURI":"mongodb://:@:27017/od",

...
winston.info('Some text');

I'm pretty sure my FQDN is pointed to the primary mongo replica. Am I missing anything?

from winston-mongodb.

yurijmikhalevich avatar yurijmikhalevich commented on September 23, 2024

Hi @geomartinez. Thank you, will test it.

from winston-mongodb.

MichaelTurbe avatar MichaelTurbe commented on September 23, 2024

Having the same issue; logging to a development database working fine, logging to a production replicaset is creating no records.

from winston-mongodb.

yurijmikhalevich avatar yurijmikhalevich commented on September 23, 2024

@j0n4s you url is missing ?replicaSet=<rsName> parameter. It works fine for me with the valid url.
@geomartinez, @MichaelTurbe can you post url you are using?

winston-mongodb$ npm run test-rs will run tests on replica set with the following url:
mongodb://localhost:27017,localhost:27018/winston?replicaSet=rs0
You can execute test against your production replicaSet by executing

winston-mongodb$ USER_WINSTON_MONGODB_URL='mongodb://...' npm run test-rs

from winston-mongodb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.