Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mylovegy/log-agent
搜集日志,写入到MongoDB、Redis中
https://github.com/mylovegy/log-agent
Last synced: 11 days ago
JSON representation
搜集日志,写入到MongoDB、Redis中
- Host: GitHub
- URL: https://github.com/mylovegy/log-agent
- Owner: myloveGy
- Created: 2021-09-20T04:11:21.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-10-28T04:40:41.000Z (about 2 years ago)
- Last Synced: 2024-11-07T21:15:22.086Z (2 months ago)
- Language: Go
- Size: 475 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LogAgent
监听日志写入,然后输出到mongodb中
## 配置说明
使用ini配置、配置文件在目录下的 `config.ini` 中
```ini
app_name = 日志收集处理
[mongodb]
host = localhost
port = 27017
database = log
username =
password =
[log.laravel]
path = /www/admin/storage/logs/
filename = laravel-2006-01-02.log
rule = true
type = json
driver = mongo
name = laravel
[log.wechat]
path = /www/admin/storage/logs/
filename = wechat-2006-01-02.log
rule = true
type = json
driver = mongo
name = wechat
```### 日志配置项说明
| 配置项 | 说明 |
|----------|--------------------------------------------|
| path | 监听文件路径 |
| filename | 监听文件名称 |
| rule | 文件是否格式化(默认false) |
| type | 读取到每一行的数据格式(取决于你日志写入格式) 目前: `json`, `text` |
| driver | 写入的类型; 目前: `mongo` |
| name | 写入的字段名称(对应`mongo`的集合名称) |### 监听文件名称: path + 格式化后的 `filename`
例如:
目前处理 laravel 的日志 laravel-2006-01-02.log
rule=true 会被格式化: laravel-年-月-日.log