Skip to content

Commit

Permalink
chore: normalize log ouput
Browse files Browse the repository at this point in the history
Added targets to all services especially when they start: [HTTP
Tracker], [UDP Tracker], etc.

```
Loading default configuration file: `./share/default/config/tracker.development.sqlite3.toml` ...
2024-01-11T17:12:11.134816964+00:00 [torrust_tracker::bootstrap::logging][INFO] logging initialized.
2024-01-11T17:12:11.135473883+00:00 [UDP Tracker][INFO] Starting on: udp://0.0.0.0:6969
2024-01-11T17:12:11.135494422+00:00 [UDP Tracker][INFO] Started on: udp://0.0.0.0:6969
2024-01-11T17:12:11.135503672+00:00 [torrust_tracker::bootstrap::jobs][INFO] TLS not enabled
2024-01-11T17:12:11.135587738+00:00 [HTTP Tracker][INFO] Starting on: http://0.0.0.0:7070
2024-01-11T17:12:11.135612497+00:00 [HTTP Tracker][INFO] Started on: http://0.0.0.0:7070
2024-01-11T17:12:11.135619586+00:00 [torrust_tracker::bootstrap::jobs][INFO] TLS not enabled
2024-01-11T17:12:11.135675454+00:00 [API][INFO] Starting on http://127.0.0.1:1212
2024-01-11T17:12:11.135688443+00:00 [API][INFO] Started on http://127.0.0.1:1212
2024-01-11T17:12:11.135701143+00:00 [Health Check API][INFO] Starting on: http://127.0.0.1:1313
2024-01-11T17:12:11.135718012+00:00 [Health Check API][INFO] Started on: http://127.0.0.1:1313
```
  • Loading branch information
josecelano committed Jan 11, 2024
1 parent 0c1f389 commit 5fd0c84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bootstrap/jobs/health_check_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ pub async fn start_job(config: Arc<Configuration>) -> JoinHandle<()> {

// Run the API server
let join_handle = tokio::spawn(async move {
info!("Starting Health Check API server: http://{}", bind_addr);
info!(target: "Health Check API", "Starting on: http://{}", bind_addr);

Check warning on line 47 in src/bootstrap/jobs/health_check_api.rs

View check run for this annotation

Codecov / codecov/patch

src/bootstrap/jobs/health_check_api.rs#L47

Added line #L47 was not covered by tests

let handle = server::start(bind_addr, tx_start, config.clone());

if let Ok(()) = handle.await {
info!("Health Check API server on http://{} stopped", bind_addr);
info!(target: "Health Check API", "Stopped server running on: http://{}", bind_addr);

Check warning on line 52 in src/bootstrap/jobs/health_check_api.rs

View check run for this annotation

Codecov / codecov/patch

src/bootstrap/jobs/health_check_api.rs#L52

Added line #L52 was not covered by tests
}
});

// Wait until the API server job is running
match rx_start.await {
Ok(msg) => info!("Torrust Health Check API server started on: http://{}", msg.address),
Ok(msg) => info!(target: "Health Check API", "Started on: http://{}", msg.address),

Check warning on line 58 in src/bootstrap/jobs/health_check_api.rs

View check run for this annotation

Codecov / codecov/patch

src/bootstrap/jobs/health_check_api.rs#L58

Added line #L58 was not covered by tests
Err(e) => panic!("the Health Check API server was dropped: {e}"),
}

Expand Down

0 comments on commit 5fd0c84

Please sign in to comment.