-
Notifications
You must be signed in to change notification settings - Fork 50
Mongodblogger settings
In this page explained each parameter of MongodbLogger settings.
Name of MongoDB database, where was created collection for store logs. If you using Mongoid, when MongodbLogger will use Mongoid database (if you not setup mongodb_logger.yml).
Example:
database: my_app
For logging into MongoDB, MongodbLogger use special type of collection - capped collections (More info). Capped collections provide a high-performance means for storing logging documents in the database. Inserting objects in an unindexed capped collection will be close to the speed of logging to a filesystem. Additionally, with the built-in FIFO mechanism, you are not at risk of using excessive disk space for the logging. This params setup size of capped collection.
Example:
capsize: <%= 100.megabytes %> # set 100 MB
This parameter give information, how to connect to MongoDB.
This parameter give information, how to connect to MongoDB.
Auth username.
Auth password.
If you have several MongoDB in replication, this parameter should be in "true" state. In this case, if master of MongoDB will down, the MongodbLogger will try reconnect to new MongoDB master.
This parameter enable/disable safe inserts. Enabling this driver option is called "safe mode". When enabled, the driver piggybacks a getLastError message with each write message. It then awaits the result of the getLastError command before returning. For maximum speed, skip the getLastError (or "safe mode") for noncritical writes (set to "false"). Use it when you need to confirm to the write succeeded (in my practical logging this will happen 0 times).
This parameter set application_name in log. This parameter can be usefull, if you have several web nodes, which write logs in same storage and want to know, what node write this log.
By default MongodbLogger not block logging into file. But, sometimes, you no need such function - you need write logs ONLY into MongoDB. For enable such functionality set this parameter "true".
By default MongodbLogger create and write logs into "#{Rails.env}_log" collection. By this parameter you can customize name of using collection.