diff --git a/docs/tutorials/log.md b/docs/tutorials/log.md index 0024839..90ac069 100644 --- a/docs/tutorials/log.md +++ b/docs/tutorials/log.md @@ -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: @@ -128,4 +128,38 @@ loggers: maxBackups: 3 localTime: false compress: false -``` \ No newline at end of file +``` + +## 日志记录器组 + +也可以通过日志记录器组来组合使用多个日志记录器。 + +```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 +``` diff --git a/en/docs/tutorials/log.md b/en/docs/tutorials/log.md index 0a393e5..d8aac64 100644 --- a/en/docs/tutorials/log.md +++ b/en/docs/tutorials/log.md @@ -128,4 +128,38 @@ loggers: maxBackups: 3 localTime: false compress: false -``` \ No newline at end of file +``` + +## 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 +```