title: How to log error with unique id and send that id in rest response?
body: <p>I am working on spring boot application where I want to log exception with unique id in log file and send that id in response to user, so user can provide that id to support team and they can get log from file by searching this id.</p>
  
  <p>I am using @ControllerAdvice to handle error globaly I am printing log like below
  I didn't configure logger yet, just using with default seeting </p>
  
  <pre><code>import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
    protected static final Logger logger = LoggerFactory.getLogger(RestResponseEntityExceptionHandler.class);
    logger.error("Error",ex);
  </code></pre>
  
  <p>ex- is exception object</p>
  
  <p>Its printing log like below</p>
  
  <pre><code>2018-04-06 17:45:37.566 ERROR [micro-app,912f0faf43795429,912f0faf43795429,false] 8660 --- [nio-9530-exec-1] d.d.c.RestResponseEntityExceptionHandler : Error
  
  javax.ws.rs.ClientErrorException: entity.notFound
      at com.ge.managers.impl.AssetCompanyRelationshipManager.get(AssetCompanyRelationshipManager.java:139) ~[classes/:na]
  </code></pre>
  
  <p>micro-app is my application namebut what is 912f0faf43795429,912f0faf43795429 these id here? is it unique for each error, how i can access them and send in response.</p>
  
  <p>If its not possible to use this id as unique referece error Please suggest possible approch.</p>
  
  <p>Thanks</p>