how do I set the logging level to info for MongoDb?

前端 未结 3 667
无人共我
无人共我 2021-01-05 15:21

I have a Rails app that uses MongoDb on the back. I have these messages that say MONGODB [WARNING] Please note that logging negatively impacts client-side performance.

3条回答
  •  遥遥无期
    2021-01-05 16:18

    If you're using mongoid 2.2 or higher, you can set it in mongoid.yml:

    production:
      hosts:
        ...
      database: ...
      logger: false
    

    Also, this does have a performance impact. When I turned off mongo logging in production, I saw fewer garbage collections and app instance memory footprints were about 15 megabytes smaller during 30-minute load tests using apachebench.

提交回复
热议问题