Skip to content

Commit

Permalink
add logger group
Browse files Browse the repository at this point in the history
  • Loading branch information
ginuerzh committed Dec 19, 2023
1 parent 2e8f588 commit 916f520
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 16 deletions.
64 changes: 49 additions & 15 deletions docs/tutorials/log.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,20 @@ loggers:

```yaml hl_lines="4 11"
services:
- name: service-0
addr: :8000
logger: logger-0
handler:
type: auto
listener:
type: tcp
- name: service-1
addr: :8001
logger: logger-1
handler:
type: auto
listener:
type: tcp
- name: service-0
addr: :8000
logger: logger-0
handler:
type: auto
listener:
type: tcp
- name: service-1
addr: :8001
logger: logger-1
handler:
type: auto
listener:
type: tcp
loggers:
- name: logger-0
log:
Expand All @@ -128,4 +128,38 @@ loggers:
maxBackups: 3
localTime: false
compress: false
```
```

## 日志记录器组

也可以通过日志记录器组来组合使用多个日志记录器。

```yaml hl_lines="4-6"
services:
- name: service-0
addr: :8000
loggers:
- logger-0
- logger-1
handler:
type: auto
listener:
type: tcp
loggers:
- name: logger-0
log:
level: info
format: text
output: stderr
- name: logger-1
log:
level: debug
format: json
output: /path/to/file
rotation:
maxSize: 100
maxAge: 10
maxBackups: 3
localTime: false
compress: false
```
36 changes: 35 additions & 1 deletion en/docs/tutorials/log.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,38 @@ loggers:
maxBackups: 3
localTime: false
compress: false
```
```

## Logger Group

Multiple loggers can also be combined through logger group.

```yaml hl_lines="4-6"
services:
- name: service-0
addr: :8000
loggers:
- logger-0
- logger-1
handler:
type: auto
listener:
type: tcp
loggers:
- name: logger-0
log:
level: info
format: text
output: stderr
- name: logger-1
log:
level: debug
format: json
output: /path/to/file
rotation:
maxSize: 100
maxAge: 10
maxBackups: 3
localTime: false
compress: false
```

0 comments on commit 916f520

Please sign in to comment.