dreamfactory/df-mongo-logs
最新稳定版本:1.3.0
Composer 安装命令:
composer require dreamfactory/df-mongo-logs
包简介
DreamFactory(tm) MongoDB Logger Package
README 文档
README
DreamFactory 4.0.1 and newer supports a very simple solution for logging all requests. All records requested in the API will be written to the database. Logging API requests service currently supports only MongoDB.
Configuration
To configure the logging of all requests, you need to go to the file with the environment variables and find the LogsDB settings block.
This block contains the following variables:
LOGSDB_ENABLED- boolean flag to enable or disable logging of API requests. Possible values:"true"or"false". The default is"false".LOGSDB_HOST- the host of the database to store the logs. The default islocalhost.LOGSDB_PORT- the database connection port. The default is27017LOGSDB_DATABASE- the name of the database for logging.LOGSDB_USERNAME- username with database access permissions.LOGSDB_PASSWORD- user password.
If LOGSDB_ENABLED is set to false, no request will be logged. Also, migration will not be run.
Log structure
MongoDB document
Each request will be stored as a separate document in the access collection provided database.
Each document will be as follows:
{
"_id": ObjectId,
"timestamp": string,
"method": string,
"uri" : string,
"body" : string,
"expireAt" : ISODate
}
_id- Unique ID of document. MongoDB ObjectId docs.timestamp- Document creation date. Format "YYYY-mm-dd HH-MM-SS"method- Request method. For example:GET,POST,PUT,PATCH,DELETE.uri- Request path. For example:/api/v2/system/environment,/api/v2/system.body- Request body in the string format. For example:"{\"group\":\"source control,file\"}","{\"include_count\":\"true\"}"expireAt- The date this log will be deleted. By default, 45 days after creation. MongoDB Date docs
统计信息
- 总下载量: 24.92k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2020-03-30