feat: 日志输出IP
This commit is contained in:
@ -119,7 +119,8 @@ async fn run_server(in_thread: bool) -> std::io::Result<()> {
|
||||
let webui_server = HttpServer::new(|| {
|
||||
App::new()
|
||||
.wrap_fn(|req, srv| {
|
||||
logger::info(&format!("WebUI Request: {}", req.path())); // 使用日志记录
|
||||
let ip = req.peer_addr().map(|addr| addr.ip().to_string()).unwrap_or_else(|| "Unknown IP".to_string());
|
||||
logger::info(&format!("from {}, WebUI Request: {}", ip, req.path()));
|
||||
srv.call(req)
|
||||
})
|
||||
.app_data(web::PayloadConfig::default().limit(1024 * 1024 * 25))
|
||||
@ -137,7 +138,8 @@ async fn run_server(in_thread: bool) -> std::io::Result<()> {
|
||||
asset_server = Some(HttpServer::new(|| {
|
||||
App::new()
|
||||
.wrap_fn(|req, srv| {
|
||||
logger::info(&format!("Assets Request: {}", req.path()));
|
||||
let ip = req.peer_addr().map(|addr| addr.ip().to_string()).unwrap_or_else(|| "Unknown IP".to_string());
|
||||
logger::info(&format!("from {}, Assets Request: {}", ip, req.path()));
|
||||
srv.call(req)
|
||||
})
|
||||
.app_data(web::PayloadConfig::default().limit(1024 * 1024 * 1024))
|
||||
|
Reference in New Issue
Block a user