Skip to content

Commit 120024e

Browse files
committed
Better debug logging.
Change-Id: Id7d49dc8614947a777287944fd3043b4d2b7a69a Signed-off-by: Piotr Sikora <[email protected]>
1 parent 9b5ce37 commit 120024e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

ngx_cache_purge_module.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -682,13 +682,21 @@ ngx_http_cache_purge_init(ngx_http_request_t *r, ngx_http_file_cache_t *cache,
682682
void
683683
ngx_http_cache_purge_handler(ngx_http_request_t *r)
684684
{
685+
ngx_int_t rc;
686+
685687
# if (NGX_HAVE_FILE_AIO)
686688
if (r->aio) {
687689
return;
688690
}
689691
# endif
690692

691-
switch (ngx_http_file_cache_purge(r)) {
693+
rc = ngx_http_file_cache_purge(r);
694+
695+
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
696+
"http file cache purge: %i, \"%s\"",
697+
rc, r->cache->file.name.data);
698+
699+
switch (rc) {
692700
case NGX_OK:
693701
r->write_event_handler = ngx_http_request_empty_handler;
694702
ngx_http_finalize_request(r, ngx_http_cache_purge_send_response(r));
@@ -762,9 +770,6 @@ ngx_http_file_cache_purge(ngx_http_request_t *r)
762770

763771
ngx_shmtx_unlock(&cache->shpool->mutex);
764772

765-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
766-
"http file cache purge: \"%s\"", c->file.name.data);
767-
768773
if (ngx_delete_file(c->file.name.data) == NGX_FILE_ERROR) {
769774
/* entry in error log is enough, don't notice client */
770775
ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,

0 commit comments

Comments
 (0)