From 916f5200332e5d9af84d12e0b42ab4307491d9d0 Mon Sep 17 00:00:00 2001 From: ginuerzh Date: Tue, 19 Dec 2023 22:00:22 +0800 Subject: [PATCH] add logger group --- docs/tutorials/log.md | 64 ++++++++++++++++++++++++++++++---------- en/docs/tutorials/log.md | 36 +++++++++++++++++++++- 2 files changed, 84 insertions(+), 16 deletions(-) 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 +```