You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "FANNG1 (via GitHub)" <gi...@apache.org> on 2024/08/07 10:06:16 UTC

Re: [I] [Improvement] TraceId Implementation for Audit Logs in Gravitino [gravitino]

FANNG1 commented on issue #3997:
URL: https://github.com/apache/gravitino/issues/3997#issuecomment-2273104293

   seems we could you `MDC` to implement this
   ```java
       protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
           String requestId = req.getHeader("X-Request-ID");
           MDC.put("requestId", requestId);
           try {
               log.info("Processing request");
               resp.getWriter().write("Request processed");
           } finally {
               MDC.clear();
           }
       }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org