You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Xray has two types of logs: access logs and error logs. You can configure the output method for each type of log separately.
6
6
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
+
7
11
## LogObject
8
12
9
13
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/
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.
38
42
39
43
-`"debug"`: Output information used for debugging the program. Includes all `"info"` content.
40
44
-`"info"`: Runtime status information, etc., which does not affect normal use. Includes all `"warning"` content.
41
45
-`"warning"`: Information output when there are some problems that do not affect normal operation but may affect user experience. Includes all `"error"` content.
42
46
-`"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.
44
48
45
49
> `dnsLog`: bool
46
50
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.
0 commit comments