The yii2-mongolog is a Yii2 module for store web application user's activity log in the MongoDB.
The preferred way to install this extension is through composer.
- Add mongolog module into modules section of your config.
- Set your MongoDB collection name for store log data.
- Set correct dsn string to connect with right MongoDB instance and database.
- Add mongolog module into bootstrap section of your config.
'modules' => [
// ...
'mongolog' => [
'class' => 'pythagor\mongolog\Module',
'logCollection' => 'YourCollectionName',
'components' => [
'db_log' => [
'class' => 'yii\mongodb\Connection',
'dsn' => 'mongodb://localhost:27017/YourDatabaseName',
],
],
],
],
'bootstrap' => [
// ...
'mongolog',
],
yii2-mongolog is released under the MIT License.