Skip to content

Commit 71ca033

Browse files
Log EN: Add more explanations (#625)
* Log: Add more explanations * Update log.md --------- Co-authored-by: 风扇滑翔翼 <Fangliding.fshxy@outlook.com>
1 parent 7f51bec commit 71ca033

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

docs/en/config/log.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Log configuration controls how Xray outputs logs.
44

55
Xray has two types of logs: access logs and error logs. You can configure the output method for each type of log separately.
66

7+
::: tip
8+
The log configuration is not applied immediately. This means that you may see some log entries made by an unconfigured logger during startup. For example, you may see several `"info"` log entries while you have configured a `"warning"` log level.
9+
:::
10+
711
## LogObject
812

913
LogObject corresponds to the `log` item in the configuration file.
@@ -34,17 +38,26 @@ The file path for the error log. The value is a valid file path, such as `"/var/
3438

3539
> `loglevel`: "debug" | "info" | "warning" | "error" | "none"
3640
37-
The log level for error logs, indicating the information that needs to be recorded. The default value is `"warning"`.
41+
The log level for error logs, indicating the information that needs to be recorded. The default value is `"warning"`. Note that this setting applies to the error log only. It doesn't affect the access log (except for `"none"` value). The access log doesn't have log levels.
3842

3943
- `"debug"`: Output information used for debugging the program. Includes all `"info"` content.
4044
- `"info"`: Runtime status information, etc., which does not affect normal use. Includes all `"warning"` content.
4145
- `"warning"`: Information output when there are some problems that do not affect normal operation but may affect user experience. Includes all `"error"` content.
4246
- `"error"`: Xray encountered a problem that cannot be run normally and needs to be resolved immediately.
43-
- `"none"`: Do not record any content.
47+
- `"none"`: Disable all logs.
4448

4549
> `dnsLog`: bool
4650
47-
Whether to enable DNS query logs, for example: `DOH//doh.server got answer: domain.com -> [ip1, ip2] 2.333ms`.
51+
Log DNS queries made by built-in [DNS clients](./dns.md) to the access log. Example log record: `DOH//doh.server got answer: domain.com -> [ip1, ip2] 2.333ms`.
52+
53+
::: tip
54+
1. Xray doesn't perform all DNS queries via its built-in clients. Therefore, enabling this option doesn't mean that all DNS queries performed by Xray will be logged.
55+
56+
2. DNS queries made by built-in [DNS clients](./dns.md) are also logged to the error log (with "Info" level) even if this option is disabled.
57+
3.
58+
4. FakeDNS client queries are never logged to the access log.
59+
:::
60+
4861

4962
> `maskAddress`: "quarter" | "half" | "full"
5063

0 commit comments

Comments
 (0)