Skip to content

Commit

Permalink
Merge pull request #1055 from sozu-proxy/setup_logging_where_needed
Browse files Browse the repository at this point in the history
setup logging in accept_clients()
  • Loading branch information
FlorentinDUBOIS authored Dec 14, 2023
2 parents a08c9b0 + 72bfab9 commit 537352c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bin/src/command/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use serde::{Deserialize, Serialize};

use sozu_command_lib::{
config::Config,
logging::setup_logging_with_config,
proto::command::{
request::RequestType, response_content::ContentType, MetricsConfiguration, Request,
Response, ResponseContent, ResponseStatus, RunState, Status,
Expand Down Expand Up @@ -399,11 +400,13 @@ impl CommandServer {
let (accept_cancel_tx, accept_cancel_rx) = oneshot::channel();
let (command_tx, command_rx) = channel(10000);
let cloned_command_tx = command_tx.clone();
let cloned_config = config.clone();

smol::spawn(accept_clients(
cloned_command_tx,
async_listener,
accept_cancel_rx,
cloned_config,
))
.detach();

Expand Down Expand Up @@ -838,11 +841,13 @@ pub fn start_server(
let (accept_cancel_tx, accept_cancel_rx) = oneshot::channel();
let (command_tx, command_rx) = channel(10000);
let cloned_command_tx = command_tx.clone();
let cloned_config = config.clone();

smol::spawn(accept_clients(
cloned_command_tx,
async_listener,
accept_cancel_rx,
cloned_config,
))
.detach();

Expand Down Expand Up @@ -891,7 +896,9 @@ async fn accept_clients(
mut command_tx: Sender<CommandMessage>,
async_listener: Async<UnixListener>,
accept_cancel_rx: oneshot::Receiver<()>,
config: Config,
) {
setup_logging_with_config(&config, "MAIN");
let mut counter = 0usize;
let mut accept_cancel_rx = Some(accept_cancel_rx);
info!("Accepting client connections");
Expand Down

0 comments on commit 537352c

Please sign in to comment.