Skip to content

Commit c198d29

Browse files
committed
update readme.
1 parent 2cd48b3 commit c198d29

File tree

2 files changed

+103
-20
lines changed

2 files changed

+103
-20
lines changed

README.cn.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Laravel Database Logger
2+
3+
支持 Guard、Auth、多文件的数据库日志工具
4+
5+
[![Build Status](https://travis-ci.org/ibrandcc/laravel-database-logger.svg?branch=master)](https://travis-ci.org/ibrandcc/laravel-database-logger)
6+
[![Build Status](https://scrutinizer-ci.com/g/ibrandcc/laravel-database-logger/badges/build.png?b=master)](https://scrutinizer-ci.com/g/ibrandcc/laravel-database-logger/build-status/master)
7+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ibrandcc/laravel-database-logger/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ibrandcc/laravel-database-logger/?branch=master)
8+
[![Latest Stable Version](https://poser.pugx.org/ibrand/laravel-database-logger/v/stable)](https://packagist.org/packages/ibrand/laravel-database-logger)
9+
[![Latest Unstable Version](https://poser.pugx.org/ibrand/laravel-database-logger/v/unstable)](https://packagist.org/packages/ibrand/laravel-database-logger)
10+
[![License](https://poser.pugx.org/ibrand/laravel-database-logger/license)](https://packagist.org/packages/ibrand/laravel-database-logger)
11+
12+
13+
## 特性
14+
15+
1. 日志文件区分匿名用户和 Guard.
16+
2. 记录执行用户
17+
3. 记录 request url
18+
4. 支持记录指定 SQL 语句类型(SELECT,INSET INTO,UPDATE,DELETE,ALTER TABLE etc.)
19+
5. 单独记录 slow sql.
20+
21+
## 安装
22+
23+
```
24+
composer require ibrand/laravel-database-logger:~1.0 -vvv
25+
```
26+
27+
**低于 Laravel5.5 版本**
28+
29+
`config/app.php` 文件中 'providers' 添加
30+
31+
```
32+
iBrand\DatabaseLogger\ServiceProvider::class
33+
```
34+
35+
发布配置文件
36+
37+
`php artisan vendor:publish --provider="iBrand\DatabaseLogger\ServiceProvider" `
38+
39+
40+
## 使用
41+
42+
### 开启日志功能
43+
44+
- 设置 `log_queries=>true``config/ibrand/dblogger.php` 配置文件中.
45+
- 设置 `DB_LOG_QUERIES = true``.env` 文件中.
46+
47+
### 使用 `databaselogger` 中间件
48+
49+
```
50+
Route::get('test', 'Controller@index')->middleware('databaselogger');
51+
```
52+
关于路由设置中间件请见官方文档
53+
54+
[laravel-routing](https://laravel.com/docs/5.5/routing#route-group-middleware)
55+
56+
## 效果
57+
58+
![snapshot_1515552729718.png](https://note.youdao.com/yws/public/resource/59a59be278b1e0604684ed422875099c/xmlnote/E8B042EEF01446589326A7A4FF016C65/9459)
59+
![snapshot_1515552729719.png](https://note.youdao.com/yws/public/resource/59a59be278b1e0604684ed422875099c/xmlnote/46ABB7598DAB429BBB4C2A722298B0FC/9462)
60+
![snapshot_1515552729720.png](https://note.youdao.com/yws/public/resource/59a59be278b1e0604684ed422875099c/xmlnote/3F4BA3E7B2B4481BA8E5AA0AA702DDF6/9465)
61+
62+
## 贡献源码
63+
64+
如果你发现任何错误或者问题,请[提交ISSUE](https://github.com/ibrandcc/laravel-database-logger/issues)
65+

README.md

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,65 @@
1-
## Laravel Database Logger
1+
# Laravel Database Logger
22

3+
A simple database logger for Laravel application, support Guard,Auth to multiple file record.
34

4-
### Why
5+
[![Build Status](https://travis-ci.org/ibrandcc/laravel-database-logger.svg?branch=master)](https://travis-ci.org/ibrandcc/laravel-database-logger)
6+
[![Build Status](https://scrutinizer-ci.com/g/ibrandcc/laravel-database-logger/badges/build.png?b=master)](https://scrutinizer-ci.com/g/ibrandcc/laravel-database-logger/build-status/master)
7+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ibrandcc/laravel-database-logger/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ibrandcc/laravel-database-logger/?branch=master)
8+
[![Latest Stable Version](https://poser.pugx.org/ibrand/laravel-database-logger/v/stable)](https://packagist.org/packages/ibrand/laravel-database-logger)
9+
[![Latest Unstable Version](https://poser.pugx.org/ibrand/laravel-database-logger/v/unstable)](https://packagist.org/packages/ibrand/laravel-database-logger)
10+
[![License](https://poser.pugx.org/ibrand/laravel-database-logger/license)](https://packagist.org/packages/ibrand/laravel-database-logger)
511

6-
1. iBrand 是一个电商 + 新零售的交易类产品,所以对金额数据比较敏感。对于后台管理的操作需要进行操作日志,主要用于追踪操作记录。
7-
2. iBrand 产品包含 H5微商城(VUE),小程序,导购小程序端,因此是前后端完全分离的,在这种情况下,没有一个跟踪分析 API SQL 执行效率的工具。特别是后期需求越来越复杂,使用 Laravel Eloquent ORM 是非常方便,但也容易造成性能问题。而 Laravel debugger 只适用于 web 应用。因此需要个工具来分析每个请求产生的 SQL 执行语句和执行效率。
12+
- [Chinese Documentation](./README.cn.md)
813

14+
## Feature
915

10-
### Feature
16+
1. Log files support anonymous or guard types.
17+
2. Record auth uesrs.
18+
3. Record request url
19+
4. Support record specifying SQL statement(SELECT,INSET INTO,UPDATE,DELETE,ALTER TABLE etc.)
20+
5. Record slow logs separately.
1121

12-
1. 日志文件区分匿名用户和 Guard.
13-
2. 记录执行用户
14-
3. 记录 request url
15-
4. 支持记录指定 SQL 语句类型(SELECT,INSET INTO,UPDATE,DELETE,ALTER TABLE etc.)
16-
5. 单独记录 slow sql.
17-
18-
### 安装
22+
## Installation
1923

2024
```
2125
composer require ibrand/laravel-database-logger:~1.0 -vvv
2226
```
2327

24-
**低于 Laravel5.5 版本**
28+
**Below Laravel5.5 version**
2529

26-
`config/app.php` 文件中 'providers' 添加
30+
In `config/app.php` 'providers' region add
2731

2832
```
2933
iBrand\DatabaseLogger\ServiceProvider::class
3034
```
3135

32-
`php artisan vendor:publish --provider="iBrand\DatabaseLogger\ServiceProvider" `
36+
Publish config file.
37+
38+
```
39+
php artisan vendor:publish --provider="iBrand\DatabaseLogger\ServiceProvider"
40+
```
41+
42+
## Usage
3343

44+
### Enable in .env or config file.
3445

35-
### 使用
46+
Set `log_queries=>true` in `config/ibrand/dblogger.php` file. or set `DB_LOG_QUERIES = true` in `.env` file.
3647

37-
1. add `databaselogger` middleware to route.
38-
2. set `log_queries=>true` in `config/ibrand/dblogger.php` file. or set `DB_LOG_QUERIES = true` in `.env` file.
48+
### use `databaselogger` middleware
3949

40-
### 效果
50+
```
51+
Route::get('test', 'Controller@index')->middleware('databaselogger');
52+
```
53+
For more middleware users see the document.
54+
55+
[laravel-routing](https://laravel.com/docs/5.5/routing#route-group-middleware)
56+
57+
## Preview
4158

4259
![snapshot_1515552729718.png](https://note.youdao.com/yws/public/resource/59a59be278b1e0604684ed422875099c/xmlnote/E8B042EEF01446589326A7A4FF016C65/9459)
4360
![snapshot_1515552729719.png](https://note.youdao.com/yws/public/resource/59a59be278b1e0604684ed422875099c/xmlnote/46ABB7598DAB429BBB4C2A722298B0FC/9462)
4461
![snapshot_1515552729720.png](https://note.youdao.com/yws/public/resource/59a59be278b1e0604684ed422875099c/xmlnote/3F4BA3E7B2B4481BA8E5AA0AA702DDF6/9465)
4562

63+
## Contributing
4664

47-
65+
If you find any bug or problem please raise the [issue here](https://github.com/ibrandcc/laravel-database-logger/issues).

0 commit comments

Comments
 (0)