diff --git a/bin/config.toml b/bin/config.toml index a6f690681..1ed014095 100644 --- a/bin/config.toml +++ b/bin/config.toml @@ -33,12 +33,12 @@ log_target = "stdout" # optional different target for access logs (IP addresses, domains, URI, HTTP status, etc) # It supports the same options as log_target -# log_access_target = "file:///var/logs/sozu-access.log" +# access_logs_target = "file:///var/logs/sozu-access.log" # format of the access logs. Defaults to ascii. # - ascii # - protobuf (defined in [sozu_command_lib::proto::command::ProtobufAccessLog]) -# log_access_format = "ascii" +# access_logs_format = "ascii" # path to the unix socket file used to send commands to sozu # default value points to "sozu.sock" file in the current directory diff --git a/bin/my-config.0.15.18.toml b/bin/my-config.0.15.18.toml index 91fdb1d0b..0132757e3 100644 --- a/bin/my-config.0.15.18.toml +++ b/bin/my-config.0.15.18.toml @@ -1,7 +1,7 @@ log_level = "debug" log_target = "stdout" -log_access_target = "stdout" -log_access_format = "protobuf" +access_logs_target = "stdout" +access_logs_format = "protobuf" command_socket = "/home/emmanuel/clever/traffic/sozu/bin/sozu.sock" # command_buffer_size = 163840 diff --git a/bin/paris-config.toml b/bin/paris-config.toml index 856afc7c0..6eab0c120 100644 --- a/bin/paris-config.toml +++ b/bin/paris-config.toml @@ -1,6 +1,6 @@ log_level = "debug" log_target = "stdout" -log_access_target = "udp://127.0.0.1:6000" +access_logs_target = "udp://127.0.0.1:6000" command_socket = "/home/emmanuel/clever/traffic/sozu/bin/sozu.sock" diff --git a/bin/src/worker.rs b/bin/src/worker.rs index 9e1e60bb5..c3c16a7e3 100644 --- a/bin/src/worker.rs +++ b/bin/src/worker.rs @@ -116,7 +116,7 @@ pub fn begin_worker_process( setup_logging( &worker_config.log_target, worker_config.log_colored, - worker_config.log_access_target.as_deref(), + worker_config.access_logs_target.as_deref(), Some(access_log_format), Some(worker_config.log_colored), &worker_config.log_level, diff --git a/command/src/command.proto b/command/src/command.proto index 59e94de77..4d3577819 100644 --- a/command/src/command.proto +++ b/command/src/command.proto @@ -669,7 +669,7 @@ message ServerConfig { required uint64 buffer_size = 9 [default = 16393]; required string log_level = 10 [default = "info"]; required string log_target = 11 [default = "stdout"]; - optional string log_access_target = 12; + optional string access_logs_target = 12; required uint64 command_buffer_size = 13 [default = 1000000]; required uint64 max_command_buffer_size = 14 [default = 2000000]; optional ServerMetricsConfig metrics = 15; diff --git a/command/src/config.rs b/command/src/config.rs index c5a831010..5c1fd48a5 100644 --- a/command/src/config.rs +++ b/command/src/config.rs @@ -1093,11 +1093,11 @@ pub struct FileConfig { #[serde(default)] pub log_colored: bool, #[serde(default)] - pub log_access_target: Option, + pub access_logs_target: Option, #[serde(default)] - pub log_access_format: Option, + pub access_logs_format: Option, #[serde(default)] - pub log_access_colored: Option, + pub access_logs_colored: Option, pub worker_count: Option, pub worker_automatic_restart: Option, pub metrics: Option, @@ -1208,9 +1208,9 @@ impl ConfigBuilder { ctl_command_timeout: file_config.ctl_command_timeout.unwrap_or(1_000), front_timeout: file_config.front_timeout.unwrap_or(DEFAULT_FRONT_TIMEOUT), handle_process_affinity: file_config.handle_process_affinity.unwrap_or(false), - log_access_target: file_config.log_access_target.clone(), - log_access_format: file_config.log_access_format.clone(), - log_access_colored: file_config.log_access_colored, + access_logs_target: file_config.access_logs_target.clone(), + access_logs_format: file_config.access_logs_format.clone(), + access_logs_colored: file_config.access_logs_colored, log_level: file_config .log_level .clone() @@ -1458,9 +1458,9 @@ pub struct Config { pub log_target: String, pub log_colored: bool, #[serde(default)] - pub log_access_target: Option, - pub log_access_format: Option, - pub log_access_colored: Option, + pub access_logs_target: Option, + pub access_logs_format: Option, + pub access_logs_colored: Option, pub worker_count: u16, pub worker_automatic_restart: bool, pub metrics: Option, @@ -1768,8 +1768,8 @@ impl fmt::Debug for Config { .field("automatic_state_save", &self.automatic_state_save) .field("log_level", &self.log_level) .field("log_target", &self.log_target) - .field("log_access_target", &self.log_access_target) - .field("log_access_format", &self.log_access_format) + .field("access_logs_target", &self.access_logs_target) + .field("access_logs_format", &self.access_logs_format) .field("worker_count", &self.worker_count) .field("worker_automatic_restart", &self.worker_automatic_restart) .field("metrics", &self.metrics) @@ -1823,11 +1823,11 @@ impl From<&Config> for ServerConfig { buffer_size: config.buffer_size, log_level: config.log_level.clone(), log_target: config.log_target.clone(), - log_access_target: config.log_access_target.clone(), + access_logs_target: config.access_logs_target.clone(), command_buffer_size: config.command_buffer_size, max_command_buffer_size: config.max_command_buffer_size, metrics, - access_log_format: ProtobufAccessLogFormat::from(&config.log_access_format) as i32, + access_log_format: ProtobufAccessLogFormat::from(&config.access_logs_format) as i32, log_colored: config.log_colored, } } diff --git a/command/src/logging/logs.rs b/command/src/logging/logs.rs index bbde03ce3..9c06a74d6 100644 --- a/command/src/logging/logs.rs +++ b/command/src/logging/logs.rs @@ -591,9 +591,9 @@ pub fn setup_logging_with_config(config: &Config, tag: &str) { setup_logging( &config.log_target, config.log_colored, - config.log_access_target.as_deref(), - config.log_access_format.clone(), - config.log_access_colored, + config.access_logs_target.as_deref(), + config.access_logs_format.clone(), + config.access_logs_colored, &config.log_level, tag, ) @@ -606,14 +606,14 @@ pub fn setup_logging_with_config(config: &Config, tag: &str) { pub fn setup_logging( log_target: &str, log_colored: bool, - log_access_target: Option<&str>, - log_access_format: Option, - log_access_colored: Option, + access_logs_target: Option<&str>, + access_logs_format: Option, + access_logs_colored: Option, log_level: &str, tag: &str, ) { let backend = target_to_backend(log_target); - let access_backend = log_access_target.map(target_to_backend); + let access_backend = access_logs_target.map(target_to_backend); Logger::init( tag.to_string(), @@ -621,8 +621,8 @@ pub fn setup_logging( backend, log_colored, access_backend, - log_access_format, - log_access_colored, + access_logs_format, + access_logs_colored, ); } diff --git a/doc/configure.md b/doc/configure.md index f02188e92..da7272a00 100644 --- a/doc/configure.md +++ b/doc/configure.md @@ -21,7 +21,7 @@ Parameters in the global section allow you to define the global settings shared | `saved_state` | path from which sozu tries to load its state at startup | | | `log_level` | possible values are | `debug`, `trace`, `error`, `warn`, `info`| | `log_target` | possible values are | `stdout, tcp or udp address` | -| `log_access_target` | possible values are (if activated, sends access logs to a separate target) | `stdout`, `tcp` or `udp address` | +| `access_logs_target` | possible values are (if activated, sends access logs to a separate target) | `stdout`, `tcp` or `udp address` | | `command_socket` | path to the unix socket command | | | `command_buffer_size` | size, in bytes, of the buffer used by the main process to handle commands. | | | `max_command_buffer_size` | maximum size of the buffer used by the main process to handle commands. | | diff --git a/doc/debugging_strategies.md b/doc/debugging_strategies.md index 699756b46..ba0bed062 100644 --- a/doc/debugging_strategies.md +++ b/doc/debugging_strategies.md @@ -27,7 +27,7 @@ There are three configuration options related to logging: * `tcp://127.0.0.1:9876` * `unix:///var/sozu/logs` * `file:///var/logs/sozu.log` -* `log_access_target`: if activated, sends the access logs to a separate destination +* `access_logs_target`: if activated, sends the access logs to a separate destination `log_level` follows [env_logger's level directives](https://docs.rs/env_logger/0.5.13/env_logger/). Moreover, the `RUST_LOG` environment variable can be used to override the log level. diff --git a/os-build/config.toml b/os-build/config.toml index cb816b152..8267341cd 100644 --- a/os-build/config.toml +++ b/os-build/config.toml @@ -31,7 +31,7 @@ log_target = "stdout" # optional different target for access logs (IP addresses, domains, URI, HTTP status, etc) # It supports the same options as log_target -# log_access_target = "file:///var/log/sozu-access.log" +# access_logs_target = "file:///var/log/sozu-access.log" # path to the unix socket file used to send commands to sozu # default value points to "sozu.sock" file in the current directory