Crate Actix Web

    Website: https://actix.rs/

    List of useful doc items πŸ”—

    Log (record) unmatched routes πŸ”—

    Add a default service and route (This example uses tracing to do the recording)

    default_service(web::route().to(not_found)); // Added into config
    
    #[tracing::instrument]
    pub async fn not_found(req: HttpRequest) -> actix_web::Result<HttpResponse> {
        error!("Failed to match route");
        Ok(HttpResponse::NotFound().body("404 - Not found\n"))
    }
    

    Graceful shutdown πŸ”—

    There are multiple references I found and the appropriate one depends on your use case. I’m collecting them here because I don’t want to have to search for them again. I recommend also checking out Tokio Cancellation Tokens as well as applicable to your use case.

    Resources: