Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ dns-over-https = ["shadowsocks-service/dns-over-https"]
dns-over-h3 = ["shadowsocks-service/dns-over-h3"]

# Enable logging output
logging = ["log4rs", "tracing", "tracing-subscriber", "time"]
logging = ["log4rs", "tracing", "tracing-subscriber", "time", "tracing-appender"]

# Enable DNS-relay
local-dns = ["local", "shadowsocks-service/local-dns"]
Expand Down Expand Up @@ -208,6 +208,7 @@ tracing-subscriber = { version = "0.3", optional = true, features = [
"time",
"local-time",
] }
tracing-appender = { version = "0.2.3", optional = true, default-features = false }
time = { version = "0.3", optional = true }

serde = { version = "1.0", features = ["derive"] }
Expand Down
45 changes: 40 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -871,19 +871,54 @@ Example configuration:
// Service configurations
// Logger configuration
"log": {
// Default log level to use, if not overridden by `writers`, default is `0`
// Equivalent to `-v` command line option
"level": 1,
// Default log format to use, if not overridden by `writers`
"format": {
// Euiqvalent to `--log-without-time`
// Euiqvalent to `--log-without-time`, default is `false`
"without_time": false,
},
// Equivalent to `--log-config`
// More detail could be found in https://crates.io/crates/log4rs
"config_path": "/path/to/log4rs/config.yaml"
// Advanced logging configuration for configuring multiple writers
// A stdout writer will be configured by default.
// Set this to empty array `[]` to disable logging completely
"writers": [
{
// Configure a stdout writer
// The inner fields are optional, if not set, it will use the default values
// To minimally configure a stdout writer, simply write `"stdout": {}`.
"stdout": {
"level": 2,
"format": {
"without_time": false,
}
}
},
{
// Configure a file writer, useful when running as a Windows Service
"file": {
// `level` and `format` can also be set here, if not set, it will use the default values

// Required. Directory to store log files
"directory": "/var/log/shadowsocks-rust",
// Optional. Log rotation frequency, must be one of the following:
// - never (default): This will result in log file located at `directory/prefix.suffix`
// - daily: A new log file in the format of `directory/prefix.yyyy-MM-dd.suffix` will be created daily
// - hourly: A new log file in the format of `directory/prefix.yyyy-MM-dd-HH.suffix` will be created hourly
"rotation": "never",
// Optional. Prefix of log file, default is one of `sslocal`, `ssserver`, `ssmanager` depending on the service being run.
"prefix": "shadowsocks-rust",
// Optional. Suffix of log file, default is `log`
"suffix": "log",
// Optional. If set, keeps the last N log files
"max_files": 5
}
}
]
},
// Runtime configuration
"runtime": {
// single_thread or multi_thread
// `single_thread` or `multi_thread`
"mode": "multi_thread",
// Worker threads that are used in multi-thread runtime
"worker_count": 10
Expand Down
Loading
Loading