Skip to content

Commit 857b805

Browse files
committed
Make log messages clearer
1 parent 94892bf commit 857b805

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

src/grpc.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,11 @@ pub fn epp_headers_blocking(
586586
ngx_log_debug_http!(request, "ngx-inference: EPP returned no upstream");
587587
}
588588
Err(e) => {
589-
ngx_log_error_http!(request, "ngx-inference: EPP failed: {}", e);
589+
ngx_log_error_http!(
590+
request,
591+
"ngx-inference: EPP external service communication failed: {}",
592+
e
593+
);
590594
}
591595
}
592596
grpc_result

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ http_request_handler!(inference_access_handler, |request: &mut http::Request| {
708708
}
709709
core::Status::NGX_ERROR => {
710710
unsafe {
711-
let msg = b"ngx-inference: EPP processing failed\0";
711+
let msg = b"ngx-inference: EPP module processing failed internally\0";
712712
ngx::ffi::ngx_log_error_core(
713713
ngx::ffi::NGX_LOG_INFO as ngx::ffi::ngx_uint_t,
714714
request.as_mut().connection.as_ref().unwrap().log,
@@ -725,7 +725,7 @@ http_request_handler!(inference_access_handler, |request: &mut http::Request| {
725725
(*(*r_ptr).connection).log,
726726
0,
727727
#[allow(clippy::manual_c_str_literals)] // FFI code
728-
cstr_ptr(b"ngx-inference: EPP rejected request with HTTP 502 - external processor error\0".as_ptr()),
728+
cstr_ptr(b"ngx-inference: Module returning HTTP 502 due to EPP processing failure (fail-closed mode)\0".as_ptr()),
729729
);
730730
}
731731
return http::HTTPStatus::BAD_GATEWAY.into();

src/modules/bbr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ unsafe fn read_request_body(
309309
(*(*r).connection).log,
310310
0,
311311
#[allow(clippy::manual_c_str_literals)] // FFI code
312-
cstr_ptr(b"ngx-inference: BBR rejected request with HTTP 413 - actual payload size %uz exceeds limit %uz bytes\0".as_ptr()),
312+
cstr_ptr(b"ngx-inference: Module returning HTTP 413 - payload size %uz bytes exceeds BBR limit %uz bytes\0".as_ptr()),
313313
total_read + len,
314314
conf.bbr_max_body_size
315315
);
@@ -347,7 +347,7 @@ unsafe fn read_request_body(
347347
(*(*r).connection).log,
348348
0,
349349
#[allow(clippy::manual_c_str_literals)] // FFI code
350-
cstr_ptr(b"ngx-inference: BBR rejected request with HTTP 413 - actual payload size %uz exceeds limit %uz bytes\0".as_ptr()),
350+
cstr_ptr(b"ngx-inference: Module returning HTTP 413 - payload size %uz bytes exceeds BBR limit %uz bytes\0".as_ptr()),
351351
total_read + file_size,
352352
conf.bbr_max_body_size
353353
);

src/modules/epp.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl EppProcessor {
6464
Err(err) => {
6565
ngx_log_info_http!(
6666
request,
67-
"ngx-inference: EPP upstream selection failed: {}",
67+
"ngx-inference: EPP module failed to select upstream: {}",
6868
err
6969
);
7070
if conf.epp_failure_mode_allow {
@@ -214,7 +214,11 @@ impl EppProcessor {
214214
}
215215
}
216216
Err(err) => {
217-
ngx_log_info_http!(request, "ngx-inference: EPP gRPC error: {}", err);
217+
ngx_log_info_http!(
218+
request,
219+
"ngx-inference: EPP external service error: {}",
220+
err
221+
);
218222
return Err("epp grpc error");
219223
}
220224
}

0 commit comments

Comments
 (0)