title: spring boot actuator calling /actuator/logfile endpoint returning 500 with java.util.HashMap cannot be cast to org.springframework.core.io.Resource
body: <p>As per the error its looking like it found the log file but before returning it is failing during some conversion.
  application.yml</p>
  
  <pre><code>logging:
    path: logs
    file: ${logging.path}/api.log
  
  management:
    endpoints:
      logfile: logs/api.log
  </code></pre>
  
  <p>Response:</p>
  
  <pre><code>{
    "error": {
    "status": 500,
    "message": "java.util.HashMap cannot be cast to 
               org.springframework.core.io.Resource",
    "description": "uri=/api/logfile"
    }
  }
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>Log in console</p>
  
  <pre><code>2019-06-28 16:02:31,221 DEBUG[https-jsse-nio-443-exec-4] LogFormatUtils.traceDebug:91 GET "/api-my/logfile", parameters={}
  2019-06-28 16:02:31,222 DEBUG[https-jsse-nio-443-exec-4] AbstractHandlerMapping.getHandler:420 Mapped to Actuator web endpoint 'logfile'
  2019-06-28 16:02:31,237 DEBUG[https-jsse-nio-443-exec-4] LogFormatUtils.traceDebug:91 Read "application/json;charset=UTF-8" to []
  2019-06-28 16:02:31,244 DEBUG[https-jsse-nio-443-exec-4] PropertySourcesPropertyResolver.logKeyFound:115 Found key 'logging.path' in PropertySource 'configurationProperties' with value of type String
  2019-06-28 16:02:31,250 DEBUG[https-jsse-nio-443-exec-4] AbstractMessageConverterMethodProcessor.writeWithMessageConverters:268 Using 'text/plain;charset=UTF-8', given [*/*] and supported [text/plain;charset=UTF-8]
  2019-06-28 16:02:31,251 DEBUG[https-jsse-nio-443-exec-4] LogFormatUtils.traceDebug:91 Writing [{data=file [/Users/ibabur/workspaces/sts_workspace/myService/logs/api-my-logger.log], mess (truncated)...]
  2019-06-28 16:02:31,252 DEBUG[https-jsse-nio-443-exec-4] ExceptionHandlerExceptionResolver.doResolveHandlerMethodException:403 Using @ExceptionHandler public final com.nenuphar.apimy.exception.ErrorDetails com.nenuphar.apimy.advice.CustomizedResponseEntityExceptionHandler.handleAllExceptions(java.lang.Exception,org.springframework.web.context.request.WebRequest)
  2019-06-28 16:02:31,261 DEBUG[https-jsse-nio-443-exec-4] AbstractMessageConverterMethodProcessor.writeWithMessageConverters:268 Using 'application/json', given [*/*] and supported [application/json, application/*+json, application/json, application/*+json, application/cbor]
  2019-06-28 16:02:31,262 DEBUG[https-jsse-nio-443-exec-4] LogFormatUtils.traceDebug:91 Writing [{error=com.nenuphar.apimy.exception.ErrorDetails@8743f2f}]
  2019-06-28 16:02:31,273 WARN[https-jsse-nio-443-exec-4] AbstractHandlerExceptionResolver.logException:198 Resolved [java.lang.ClassCastException: java.util.HashMap cannot be cast to org.springframework.core.io.Resource]
  2019-06-28 16:02:31,274 DEBUG[https-jsse-nio-443-exec-4] FrameworkServlet.logResult:1130 Completed 500 INTERNAL_SERVER_ERROR
  2019-06-28 16:02:31,277 DEBUG[https-jsse-nio-443-exec-4] ExceptionTranslationFilter.doFilter:121 Chain processed normally
  2019-06-28 16:02:31,278 DEBUG[https-jsse-nio-443-exec-4] SecurityContextPersistenceFilter.doFilter:119 SecurityContextHolder now cleared, as request processing completed
  </code></pre>