Skip to content

curl commands

Yash edited this page Apr 14, 2026 · 4 revisions
# ── Forward: ControllerA → ControllerB ───────────────────────────────────

# Basic forward — client gets ControllerB's response at ControllerA's URL
curl -s "http://localhost:8080/demo/forward/a" | python -m json.tool

# With request ID for log correlation
curl -s "http://localhost:8080/demo/forward/a" -H "X-Request-ID: fwd-test-001" | python -m json.tool

# Verbose — see that URL stays /demo/forward/a and response comes from ControllerB
curl -v "http://localhost:8080/demo/forward/a"

# ── Expected response from /demo/forward/a ─────────────────────────────────
# {
#   "handledBy":     "ControllerB",
#   "dispatchType":  "FORWARD",
#   "currentUri":    "/demo/forward/b",
#   "forwardedFrom": "ControllerA",
#   "originalUri":   "/demo/forward/a",
#   "fwdRequestUri": "/demo/forward/a",
#   ...
# }
# ── Expected console log ───────────────────────────────────────────────────
# [SpringOncePerRequestFilter] ▶ dispatch=REQUEST uri=/demo/forward/a  ← once only
# [ServletOncePerRequestFilter] ▶ dispatch=REQUEST  uri=/demo/forward/a
# [ControllerA] Received REQUEST dispatch — forwarding to /demo/forward/b
# [ServletOncePerRequestFilter] ▶ dispatch=FORWARD  uri=/demo/forward/a ← AGAIN
# [ControllerB] Handling FORWARD dispatch
# [ServletOncePerRequestFilter] ◀ dispatch=FORWARD  DONE               ← AGAIN
# [SpringOncePerRequestFilter] ◀ dispatch=REQUEST DONE                 ← once only

# ── Direct call to ControllerB (no forward — REQUEST dispatch) ────────────
curl -s "http://localhost:8080/demo/forward/b"
# dispatchType will be "REQUEST" not "FORWARD"
# forwardedFrom will be null (attribute not set by ControllerA)

# ── Include: DashboardController includes WidgetController ────────────────

# Dashboard composes its own content + included widget
curl -s "http://localhost:8080/demo/include/dashboard"

# ── Expected raw response ──────────────────────────────────────────────────
# {"dashboard":{"title":"Demo Dashboard","dispatchType":"REQUEST",
#   "widget":{"type":"widget","dispatchType":"INCLUDE","generatedAt":"...","data":{"metric":"requests","value":42}},
#   "status":"composed"}}

# Direct widget call (REQUEST dispatch — no include)
curl -s "http://localhost:8080/demo/include/widget"
# {"type":"widget","dispatchType":"REQUEST","generatedAt":"...","data":{"metric":"requests","value":42}}

# ── Expected console log for dashboard ────────────────────────────────────
# [SpringOncePerRequestFilter] ▶ dispatch=REQUEST uri=/demo/include/dashboard  ← once
# [ServletOncePerRequestFilter] ▶ dispatch=REQUEST  uri=/demo/include/dashboard
# [DashboardController] REQUEST dispatch — building dashboard
# [ServletOncePerRequestFilter] ▶ dispatch=INCLUDE  uri=/demo/include/dashboard ← AGAIN
# [WidgetController] dispatch=INCLUDE
# [ServletOncePerRequestFilter] ◀ dispatch=INCLUDE  DONE                       ← AGAIN
# [DashboardController] Finished
# [SpringOncePerRequestFilter] ◀ dispatch=REQUEST DONE                         ← once

api.request.logging.log-headers=true
# Comma-separated header names to omit entirely from the request log.
# Matching is case-insensitive. These never appear in the output.
api.request.logging.skip-headers=user-agent,postman-token,cache-control,accept-encoding,connection
# ── ApiDemoFilter ─────────────────────────────────────────────────────────
# Set to true to activate the demo consumer filter that validates the
# mandatory 'location' header and calls sendError(401) when absent.
# Demonstrates that ApiLoggingFilter captures the request body and error
# response even when the chain is short-circuited.
internal.app.non-consumer.filter=true

# ── EnableWebMVCConfig ────────────────────────────────────────────────────
# Set to true to activate @EnableWebMvc in the demo context.
# This intentionally disables WebMvcAutoConfiguration (and therefore
# OrderedRequestContextFilter at order -105) to reproduce the exception:
#   "No thread-bound request found: Scope 'request' is not active"
#
# The fix is in ApiRequestLoggingAutoConfiguration:
#   @Bean @ConditionalOnMissingBean(RequestContextFilter.class)
#   public OrderedRequestContextFilter starterRequestContextFilter() { ... }
#
# With the fix present, requests succeed normally even with @EnableWebMvc.
# Without the fix, every request throws BeanCreationException.
#
# WARNING: enabling this together with internal.app.non-consumer.filter=true
# is the most complete reproduction of a real consumer app scenario.
internal.app.non-consumer.web.mvc=true

internal.app.non-consumer.filter=true
Request/Response LOG
ApiDemoFilter : internal.app.non-consumer.filter=true
curl --location 'http://localhost:8080/api/orders' \
--header 'Content-Type: application/json' \
--data '{"customerId":"C-101","itemName":"Laptop","amount":999.99}'
{
    "timestamp": "2026-04-11T05:09:29.946+0000",
    "status": 401,
    "error": "Unauthorized",
    "message": "Please provide the required 'location' header.",
    "path": "/api/orders"
}
=========== Request Logs [req-id: b275e1d4-98c5-4b55-b4e2-b477fc420086] ===========
── INCOMING
   requestId: b275e1d4-98c5-4b55-b4e2-b477fc420086
   threadName: http-nio-8080-exec-1
   timestamp: 11/4/2026, 10:39:29 am
   url: /api/ordersContextPath[] — ServletPath[/api/orders]
   httpMethod: POST
   headers: {"content-type":"application/json","accept":"*/*","host":"localhost:8080","content-length":"58"}
   requestBodyType: raw
   requestBody: {"customerId":"C-101","itemName":"Laptop","amount":999.99}
   responseStatus: 401
   responseError: HTTP 401Unauthorized
   requestProcessedTime: 0h 0m 0s 33ms
════════════════════════════════════════════════════════
ApiDemoFilter : internal.app.non-consumer.filter=true
with --header 'location: IN'
curl --location 'http://localhost:8080/api/orders' \
--header 'Content-Type: application/json' \
--header 'location: IN' \
--data '{"customerId":"C-101","itemName":"Laptop","amount":999.99}'
{
    "orderId": "ORD-878FE907",
    "status": "CONFIRMED",
    "customerId": "C-101",
    "itemName": "Laptop",
    "amount": 999.99,
    "transactionId": "TXN-B5D7960A",
    "requestId": "b6dd286a-c49c-425c-827e-23d7f8e6c8ce"
}
=========== Request Logs [req-id: ab36f58d-90b8-4280-9279-c063cc90d421] ===========
── INCOMING
   requestId: ab36f58d-90b8-4280-9279-c063cc90d421
   threadName: http-nio-8080-exec-6
   timestamp: 11/4/2026, 10:41:36 am
   url: /api/ordersContextPath[] — ServletPath[/api/orders]
   httpMethod: POST
   headers: {"content-type":"application/json","location":"IN","accept":"*/*","host":"localhost:8080","content-length":"58"}
   controllerHandler: OrderController#createOrder
   requestBodyType: raw
   requestBody: {"customerId":"C-101","itemName":"Laptop","amount":999.99}
   responseStatus: 200
   response: {"orderId":"***MASKED***","status":"CONFIRMED","customerId":"C-101","itemName":"Laptop","amount":999.99,"transactionId":"TXN-FAFF064C","requestId":"ab36f58d-90b8-4280-9279-c063cc90d421"}
   requestProcessedTime: 0h 0m 1s 473ms
── InventoryService/reserve [10:41:36.620]
itemName: Laptop
reserved: true
── PaymentGateway/charge [10:41:36.633]
request: {"orderId":"MASKED","amount":999.99,"currency":"INR"}
response: {"txnId":"MASKED","status":"SUCCESS","orderId":"MASKED","amount":999.99}
── https://api.open-meteo.com/v1/forecast?latitude=17.38&longitude=78.47&current=temperature_2m [10:41:36.711]
request: (no body)
response: {"latitude":"MASKED","longitude":"MASKED","generationtime_ms":0.0247955322265625,"utc_offset_seconds":0,"timezone":"GMT","timezone_abbreviation":"GMT","elevation":498.0,"current_units":{"time":"iso8601","interval":"seconds","temperature_2m":"°C"},"current":{"time":"2026-04-11T05:00","interval":900,"temperature_2m":35.5}}
════════════════════════════════════════════════════════


# ── Redirect demo ─────────────────────────────────────────────────────────
# Activates RedirectDemoController and RedirectDemoFilter.
# Default false — set to true to test redirectPath log capture.
internal.app.non-consumer.redirect=true

redirectPath: /api/payments/status/{txnId}

# ── Controller redirects ──────────────────────────────────────────────────

# 1. ResponseEntity redirect (302) — most explicit Spring approach
curl -v http://localhost:8080/demo/redirect/spring
# Expect: HTTP 302   Location: /api/payments/status/{txnId}
# Log:    redirectPath: /api/payments/status/{txnId}

# 2. "redirect:" view name (302)
curl -v http://localhost:8080/demo/redirect/view
# Expect: HTTP 302   Location: http://localhost:8080/api/payments/status/{txnId}
# Log:    redirectPath: http://localhost:8080/api/payments/status/{txnId}

# 3. HttpServletResponse.sendRedirect (302)
curl -v http://localhost:8080/demo/redirect/servlet
# Expect: HTTP 302   Location: http://localhost:8080/api/payments/status/{txnId}
# Log:    redirectPath: http://localhost:8080/api/payments/status/{txnId}

# 4. Permanent redirect (301)
curl -v http://localhost:8080/demo/redirect/permanent
# Expect: HTTP 301   Location: /api/payments/status/{txnId}
# Log:    redirectPath: /api/payments/status/{txnId}

# 5. External URL redirect (302)
curl -v "http://localhost:8080/demo/redirect/external?to=https://example.com"
# Expect: HTTP 302   Location: https://example.com
# Log:    redirectPath: https://example.com
tested logs
# 1. ResponseEntity redirect (302) — most explicit Spring approach
curl -v http://localhost:8080/demo/redirect/spring

RedirectDemoController       : [RedirectDemoController] /spring → redirect to /api/payments/status/{txnId}
{
    "txnId": "1",
    "status": "CAPTURED",
    "orderId": "ORD-UNKNOWN",
    "amount": 0.0
}

2026-04-11 11:57:00.681  INFO 3140 --- [nio-8080-exec-3] api.request.logging                      : 
=========== Request Logs [req-id: a9354ddf-5865-42c3-947c-c7e0130bda2d] ===========
── INCOMING
   requestId: a9354ddf-5865-42c3-947c-c7e0130bda2d
   threadName: http-nio-8080-exec-3
   timestamp: 11/4/2026, 11:57:00 am
   url: /demo/redirect/spring ➤ ContextPath[] — ServletPath[/demo/redirect/spring]
   httpMethod: GET
   headers: {"accept":"*/*","host":"localhost:8080"}
   controllerHandler: RedirectDemoController#redirectViaResponseEntity
   requestBodyType: raw
   redirectPath: /api/payments/status/1
   responseStatus: 302
   response: (empty)
   requestProcessedTime: 0h 0m 0s 125ms
════════════════════════════════════════════════════════

2026-04-11 11:57:00.790  INFO 3140 --- [nio-8080-exec-3] api.request.logging                      : 
=========== Request Logs [req-id: b439b0c2-4527-4fb1-bafd-14029a0fcd9b] ===========
── INCOMING
   requestId: b439b0c2-4527-4fb1-bafd-14029a0fcd9b
   threadName: http-nio-8080-exec-3
   timestamp: 11/4/2026, 11:57:00 am
   url: /api/payments/status/1 ➤ ContextPath[] — ServletPath[/api/payments/status/1]
   httpMethod: GET
   headers: {"accept":"*/*","referer":"http://localhost:8080/demo/redirect/spring","host":"localhost:8080"}
   controllerHandler: PaymentController#checkStatus
   requestBodyType: raw
   responseStatus: 200
   response: {"txnId":"***MASKED***","status":"CAPTURED","orderId":"***MASKED***","amount":0.0}
   requestProcessedTime: 0h 0m 0s 94ms

── PaymentGateway/status [11:57:00.722]
   txnId: 1
   response: {"txnId":"***MASKED***","status":"CAPTURED","orderId":"***MASKED***","amount":0.0}
════════════════════════════════════════════════════════

# 2. "redirect:" view name (302)
curl -v http://localhost:8080/demo/redirect/view

RedirectDemoController       : [RedirectDemoController] /view → redirect: /api/payments/status/{txnId}
redirect:/api/payments/status/{txnId}

2026-04-11 11:58:01.978  INFO 3140 --- [nio-8080-exec-5] api.request.logging                      : 
=========== Request Logs [req-id: 2981923f-3b5d-4b75-b728-58d93261c745] ===========
── INCOMING
   requestId: 2981923f-3b5d-4b75-b728-58d93261c745
   threadName: http-nio-8080-exec-5
   timestamp: 11/4/2026, 11:58:01 am
   url: /demo/redirect/view ➤ ContextPath[] — ServletPath[/demo/redirect/view]
   httpMethod: GET
   headers: {"accept":"*/*","host":"localhost:8080"}
   controllerHandler: RedirectDemoController#redirectViaViewName
   requestBodyType: raw
   responseStatus: 200
   response: redirect:/api/payments/status/{txnId}
   requestProcessedTime: 0h 0m 0s 9ms
════════════════════════════════════════════════════════

# 3. HttpServletResponse.sendRedirect (302)
curl -v http://localhost:8080/demo/redirect/servlet

RedirectDemoController       : [RedirectDemoController] /servlet → sendRedirect /api/payments/status/{txnId}{
    "txnId": "1",
    "status": "CAPTURED",
    "orderId": "ORD-UNKNOWN",
    "amount": 0.0
}

2026-04-11 11:58:57.054  INFO 3140 --- [nio-8080-exec-6] api.request.logging                      : 
=========== Request Logs [req-id: 8bca09fa-ae40-4923-a3b4-f1eef84ec677] ===========
── INCOMING
   requestId: 8bca09fa-ae40-4923-a3b4-f1eef84ec677
   threadName: http-nio-8080-exec-6
   timestamp: 11/4/2026, 11:58:57 am
   url: /demo/redirect/servlet ➤ ContextPath[] — ServletPath[/demo/redirect/servlet]
   httpMethod: GET
   headers: {"accept":"*/*","host":"localhost:8080"}
   controllerHandler: RedirectDemoController#redirectViaServletResponse
   requestBodyType: raw
   redirectPath: http://localhost:8080/api/payments/status/1
   responseStatus: 302
   response: (empty)
   requestProcessedTime: 0h 0m 0s 6ms
════════════════════════════════════════════════════════

2026-04-11 11:58:57.071  INFO 3140 --- [nio-8080-exec-7] api.request.logging                      : 
=========== Request Logs [req-id: 0d0157b1-535b-4050-b44a-c3b41fa6121c] ===========
── INCOMING
   requestId: 0d0157b1-535b-4050-b44a-c3b41fa6121c
   threadName: http-nio-8080-exec-7
   timestamp: 11/4/2026, 11:58:57 am
   url: /api/payments/status/1 ➤ ContextPath[] — ServletPath[/api/payments/status/1]
   httpMethod: GET
   headers: {"accept":"*/*","referer":"http://localhost:8080/demo/redirect/servlet","host":"localhost:8080"}
   controllerHandler: PaymentController#checkStatus
   requestBodyType: raw
   responseStatus: 200
   response: {"txnId":"***MASKED***","status":"CAPTURED","orderId":"***MASKED***","amount":0.0}
   requestProcessedTime: 0h 0m 0s 6ms

── PaymentGateway/status [11:58:57.067]
   txnId: 1
   response: {"txnId":"***MASKED***","status":"CAPTURED","orderId":"***MASKED***","amount":0.0}
════════════════════════════════════════════════════════

# 4. Permanent redirect (301)
curl -v http://localhost:8080/demo/redirect/permanent

RedirectDemoController       : [RedirectDemoController] /permanent → 301 to /api/payments/status/{txnId}
{
    "txnId": "1",
    "status": "CAPTURED",
    "orderId": "ORD-UNKNOWN",
    "amount": 0.0
}

2026-04-11 12:00:50.887  INFO 3140 --- [io-8080-exec-10] api.request.logging                      : 
=========== Request Logs [req-id: ef5ac24e-9d17-4bf8-be5b-663e0dd6a09d] ===========
── INCOMING
   requestId: ef5ac24e-9d17-4bf8-be5b-663e0dd6a09d
   threadName: http-nio-8080-exec-10
   timestamp: 11/4/2026, 12:00:50 pm
   url: /demo/redirect/permanent ➤ ContextPath[] — ServletPath[/demo/redirect/permanent]
   httpMethod: GET
   headers: {"accept":"*/*","host":"localhost:8080"}
   controllerHandler: RedirectDemoController#redirectPermanent
   requestBodyType: raw
   redirectPath: /api/payments/status/1
   responseStatus: 301
   response: (empty)
   requestProcessedTime: 0h 0m 0s 5ms
════════════════════════════════════════════════════════

2026-04-11 12:00:50.899  INFO 3140 --- [nio-8080-exec-1] api.request.logging                      : 
=========== Request Logs [req-id: f96102de-61f9-4ff9-b71c-9211dba6ffc2] ===========
── INCOMING
   requestId: f96102de-61f9-4ff9-b71c-9211dba6ffc2
   threadName: http-nio-8080-exec-1
   timestamp: 11/4/2026, 12:00:50 pm
   url: /api/payments/status/1 ➤ ContextPath[] — ServletPath[/api/payments/status/1]
   httpMethod: GET
   headers: {"accept":"*/*","referer":"http://localhost:8080/demo/redirect/permanent","host":"localhost:8080"}
   controllerHandler: PaymentController#checkStatus
   requestBodyType: raw
   responseStatus: 200
   response: {"txnId":"***MASKED***","status":"CAPTURED","orderId":"***MASKED***","amount":0.0}
   requestProcessedTime: 0h 0m 0s 4ms

── PaymentGateway/status [12:00:50.896]
   txnId: 1
   response: {"txnId":"***MASKED***","status":"CAPTURED","orderId":"***MASKED***","amount":0.0}
════════════════════════════════════════════════════════


# 5. External URL redirect (302)
curl -v "http://localhost:8080/demo/redirect/external?to=https://example.com"

RedirectDemoController       : [RedirectDemoController] /external → redirect to https://example.com
<!doctype html><html lang="en"><head><title>Example Domain</title><meta name="viewport" content="width=device-width, initial-scale=1"><style>body{background:#eee;width:60vw;margin:15vh auto;font-family:system-ui,sans-serif}h1{font-size:1.5em}div{opacity:0.8}a:link,a:visited{color:#348}</style></head><body><div><h1>Example Domain</h1><p>This domain is for use in documentation examples without needing permission. Avoid use in operations.</p><p><a href="https://iana.org/domains/example">Learn more</a></p></div></body></html>

2026-04-11 12:03:13.884  INFO 3140 --- [nio-8080-exec-4] api.request.logging                      : 
=========== Request Logs [req-id: 49e94f88-5af8-4f88-95aa-f454ccf330b8] ===========
── INCOMING
   requestId: 49e94f88-5af8-4f88-95aa-f454ccf330b8
   threadName: http-nio-8080-exec-4
   timestamp: 11/4/2026, 12:03:13 pm
   url: /demo/redirect/external ➤ ContextPath[] — ServletPath[/demo/redirect/external]
   httpMethod: GET
   headers: {"accept":"*/*","host":"localhost:8080"}
   queryParams: to=https://example.com
   controllerHandler: RedirectDemoController#redirectExternal
   requestBodyType: raw
   redirectPath: https://example.com
   responseStatus: 302
   response: (empty)
   requestProcessedTime: 0h 0m 0s 5ms
════════════════════════════════════════════════════════
# ── Filter redirect ───────────────────────────────────────────────────────

# 6. Filter-level redirect — chain never reaches controller (chainInvoked=false)
curl -v http://localhost:8080/demo/filter-redirect/login
# Expect: HTTP 302   Location: /login
# Log:    redirectPath: /login

# 7. Filter redirect to default target
curl -v http://localhost:8080/demo/filter-redirect
# Expect: HTTP 302   Location: /api/payments/status/{txnId}
# Log:    redirectPath: /api/payments/status/{txnId}

# 8. Filter redirect with custom path
curl --location 'http://localhost:8080/demo/filter-redirect/demo/redirect/spring'
# → RedirectDemoFilter      : [RedirectDemoFilter] Redirecting /demo/filter-redirect/demo/redirect/spring → /demo/redirect/spring
# Expect: HTTP 302   Location: /demo/filter-redirect/demo/redirect/spring
# Log:    redirectPath: http://localhost:8080/demo/redirect/spring
# → RedirectDemoController  : [RedirectDemoController] /spring → redirect to /api/payments/status/{txnId}
# Expect: HTTP 302   Location: /demo/redirect/spring
# Log:    redirectPath:  /api/payments/status/1

# ── Follow redirects (curl -L) ────────────────────────────────────────────
# Add -L to make curl follow the redirect automatically.
# Two separate log entries will appear — one for the redirect, one for the target.

curl -L -v http://localhost:8080/demo/redirect/spring
# Log entry 1: url=/demo/redirect/spring  responseStatus=302  redirectPath=/api/payments/status/{txnId}
# Log entry 2: url=/api/payments/status/{txnId}            responseStatus=200  response={...}
tested logs
# 6. Filter-level redirect — chain never reaches controller (chainInvoked=false)
curl -v http://localhost:8080/demo/filter-redirect/login

RedirectDemoFilter   : [RedirectDemoFilter] Redirecting /demo/filter-redirect/login → /login
{
    "timestamp": "2026-04-11T06:42:29.824+0000",
    "status": 404,
    "error": "Not Found",
    "message": "No message available",
    "path": "/login"
}

2026-04-11 12:12:29.781  INFO 3140 --- [nio-8080-exec-7] api.request.logging                      : 
=========== Request Logs [req-id: a40f6d7e-6c6c-47d3-8ec9-4f2446dfb0c2] ===========
── INCOMING
   requestId: a40f6d7e-6c6c-47d3-8ec9-4f2446dfb0c2
   threadName: http-nio-8080-exec-7
   timestamp: 11/4/2026, 12:12:29 pm
   url: /demo/filter-redirect/login ➤ ContextPath[] — ServletPath[/demo/filter-redirect/login]
   httpMethod: GET
   headers: {"accept":"*/*","host":"localhost:8080"}
   requestBodyType: raw
   redirectPath: http://localhost:8080/login
   responseStatus: 302
   response: (empty)
   requestProcessedTime: 0h 0m 0s 1ms
════════════════════════════════════════════════════════

2026-04-11 12:12:29.801  INFO 3140 --- [nio-8080-exec-8] api.request.logging                      : 
=========== Request Logs [req-id: e9e7555b-7c98-47e4-9a2d-fc4dd3c91f14] ===========
── INCOMING
   requestId: e9e7555b-7c98-47e4-9a2d-fc4dd3c91f14
   threadName: http-nio-8080-exec-8
   timestamp: 11/4/2026, 12:12:29 pm
   url: /login ➤ ContextPath[] — ServletPath[/login]
   httpMethod: GET
   headers: {"accept":"*/*","referer":"http://localhost:8080/demo/filter-redirect/login","host":"localhost:8080"}
   requestBodyType: raw
   responseStatus: 404
   responseError: HTTP 404 — Not Found
   requestProcessedTime: 0h 0m 0s 16ms
════════════════════════════════════════════════════════

# 7. Filter redirect to default target
curl -v http://localhost:8080/demo/filter-redirect

RedirectDemoFilter   : [RedirectDemoFilter] Redirecting /demo/filter-redirect → /api/payments/status/1
{
    "txnId": "1",
    "status": "CAPTURED",
    "orderId": "ORD-UNKNOWN",
    "amount": 0.0
}


2026-04-11 12:20:48.804  INFO 11588 --- [nio-8080-exec-1] api.request.logging                      : 
=========== Request Logs [req-id: 5003bb29-5bb7-4187-b649-3dd974bfb0c4] ===========
── INCOMING
   requestId: 5003bb29-5bb7-4187-b649-3dd974bfb0c4
   threadName: http-nio-8080-exec-1
   timestamp: 11/4/2026, 12:20:48 pm
   url: /demo/filter-redirect ➤ ContextPath[] — ServletPath[/demo/filter-redirect]
   httpMethod: GET
   headers: {"accept":"*/*","host":"localhost:8080"}
   requestBodyType: raw
   redirectPath: http://localhost:8080/api/payments/status/1
   responseStatus: 302
   response: (empty)
   requestProcessedTime: 0h 0m 0s 1ms
════════════════════════════════════════════════════════

2026-04-11 12:20:49.018  INFO 11588 --- [nio-8080-exec-3] api.request.logging                      : 
=========== Request Logs [req-id: ab1e9387-7a3d-4c3e-b83c-27119ebcae6a] ===========
── INCOMING
   requestId: ab1e9387-7a3d-4c3e-b83c-27119ebcae6a
   threadName: http-nio-8080-exec-3
   timestamp: 11/4/2026, 12:20:48 pm
   url: /api/payments/status/1 ➤ ContextPath[] — ServletPath[/api/payments/status/1]
   httpMethod: GET
   headers: {"accept":"*/*","referer":"http://localhost:8080/demo/filter-redirect","host":"localhost:8080"}
   controllerHandler: PaymentController#checkStatus
   requestBodyType: raw
   responseStatus: 200
   response: {"txnId":"***MASKED***","status":"CAPTURED","orderId":"***MASKED***","amount":0.0}
   requestProcessedTime: 0h 0m 0s 198ms

── PaymentGateway/status [12:20:48.911]
   txnId: 1
   response: {"txnId":"***MASKED***","status":"CAPTURED","orderId":"***MASKED***","amount":0.0}
════════════════════════════════════════════════════════

# 8. Filter redirect with custom path
curl -v http://localhost:8080/demo/filter-redirect/demo/redirect/spring

RedirectDemoFilter      : [RedirectDemoFilter] Redirecting /demo/filter-redirect/demo/redirect/spring → /demo/redirect/spring
RedirectDemoController  : [RedirectDemoController] /spring → redirect to /api/payments/status/{txnId}
{
    "txnId": "1",
    "status": "CAPTURED",
    "orderId": "ORD-UNKNOWN",
    "amount": 0.0
}


RedirectDemoFilter   : [RedirectDemoFilter] Redirecting /demo/filter-redirect/demo/redirect/spring → /demo/redirect/spring
2026-04-11 12:29:17.580  INFO 11588 --- [io-8080-exec-10] api.request.logging                      : 
=========== Request Logs [req-id: f4ce9818-8897-4f8c-a436-aefe61560c26] ===========
── INCOMING
   requestId: f4ce9818-8897-4f8c-a436-aefe61560c26
   threadName: http-nio-8080-exec-10
   timestamp: 11/4/2026, 12:29:17 pm
   url: /demo/filter-redirect/demo/redirect/spring ➤ ContextPath[] — ServletPath[/demo/filter-redirect/demo/redirect/spring]
   httpMethod: GET
   headers: {"accept":"*/*","host":"localhost:8080"}
   requestBodyType: raw
   redirectPath: http://localhost:8080/demo/redirect/spring
   responseStatus: 302
   response: (empty)
   requestProcessedTime: 0h 0m 0s 1ms
════════════════════════════════════════════════════════

RedirectDemoController       : [RedirectDemoController] /spring → redirect to /api/payments/status/{txnId}
2026-04-11 12:29:17.592  INFO 11588 --- [nio-8080-exec-2] api.request.logging                      : 
=========== Request Logs [req-id: 4036f355-fbaf-4e38-8eec-a8b10814fd8e] ===========
── INCOMING
   requestId: 4036f355-fbaf-4e38-8eec-a8b10814fd8e
   threadName: http-nio-8080-exec-2
   timestamp: 11/4/2026, 12:29:17 pm
   url: /demo/redirect/spring ➤ ContextPath[] — ServletPath[/demo/redirect/spring]
   httpMethod: GET
   headers: {"accept":"*/*","referer":"http://localhost:8080/demo/filter-redirect/demo/redirect/spring","host":"localhost:8080"}
   controllerHandler: RedirectDemoController#redirectViaResponseEntity
   requestBodyType: raw
   redirectPath: /api/payments/status/1
   responseStatus: 302
   response: (empty)
   requestProcessedTime: 0h 0m 0s 3ms
════════════════════════════════════════════════════════

2026-04-11 12:29:17.604  INFO 11588 --- [nio-8080-exec-1] api.request.logging                      : 
=========== Request Logs [req-id: b63a033e-1de2-440d-bb64-f0d376e17bb1] ===========
── INCOMING
   requestId: b63a033e-1de2-440d-bb64-f0d376e17bb1
   threadName: http-nio-8080-exec-1
   timestamp: 11/4/2026, 12:29:17 pm
   url: /api/payments/status/1 ➤ ContextPath[] — ServletPath[/api/payments/status/1]
   httpMethod: GET
   headers: {"accept":"*/*","referer":"http://localhost:8080/demo/redirect/spring","host":"localhost:8080"}
   controllerHandler: PaymentController#checkStatus
   requestBodyType: raw
   responseStatus: 200
   response: {"txnId":"***MASKED***","status":"CAPTURED","orderId":"***MASKED***","amount":0.0}
   requestProcessedTime: 0h 0m 0s 5ms

── PaymentGateway/status [12:29:17.601]
   txnId: 1
   response: {"txnId":"***MASKED***","status":"CAPTURED","orderId":"***MASKED***","amount":0.0}
════════════════════════════════════════════════════════


Clone this wiki locally