对返回 R 结构体的数据,在devtest 环境会在日志中打印出请求的明细,包括 url、method、header,方便代码调试。

例如:

  1. 2019-02-21 22:51:08.102 INFO 80575 --- [nio-8080-exec-1] net.dreamlu.mica.logger.RequestLogAspect.aroundApi:122 : ===> GET: /test.json
    2019-02-21 22:51:08.103 INFO 80575 --- [nio-8080-exec-1] net.dreamlu.mica.logger.RequestLogAspect.aroundApi:131 : ===headers=== host : localhost:8080
    2019-02-21 22:51:08.104 INFO 80575 --- [nio-8080-exec-1] net.dreamlu.mica.logger.RequestLogAspect.aroundApi:131 : ===headers=== connection : keep-alive
    2019-02-21 22:51:08.104 INFO 80575 --- [nio-8080-exec-1] net.dreamlu.mica.logger.RequestLogAspect.aroundApi:131 : ===headers=== accept : application/vnd.mica.v1.1+json
    2019-02-21 22:51:08.105 INFO 80575 --- [nio-8080-exec-1] net.dreamlu.mica.logger.RequestLogAspect.aroundApi:131 : ===headers=== dnt : 1
    2019-02-21 22:51:08.105 INFO 80575 --- [nio-8080-exec-1] net.dreamlu.mica.logger.RequestLogAspect.aroundApi:131 : ===headers=== user-agent : Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36
    2019-02-21 22:51:08.106 INFO 80575 --- [nio-8080-exec-1] net.dreamlu.mica.logger.RequestLogAspect.aroundApi:131 : ===headers=== referer : http://localhost:8080/swagger-ui.html
    2019-02-21 22:51:08.106 INFO 80575 --- [nio-8080-exec-1] net.dreamlu.mica.logger.RequestLogAspect.aroundApi:131 : ===headers=== accept-encoding : gzip, deflate, br
    2019-02-21 22:51:08.107 INFO 80575 --- [nio-8080-exec-1] net.dreamlu.mica.logger.RequestLogAspect.aroundApi:131 : ===headers=== accept-language : zh
    2019-02-21 22:51:08.108 INFO 80575 --- [nio-8080-exec-1] net.dreamlu.mica.logger.RequestLogAspect.aroundApi:131 : ===headers=== cookie : JSESSIONID=6hjVcr0s--iheY4QjI6XmoF0iCMxSIOVV8dB9_0q; XSRF-TOKEN=91792b58-31f9-4535-acae-c294c6b06d8d; Webstorm-a3fcc059=fd308996-20a5-4700-8e18-9a91a86001f7
    2019-02-21 22:51:08.139 INFO 80575 --- [nio-8080-exec-1] net.dreamlu.mica.logger.RequestLogAspect.aroundApi:137 : ===Result=== {"code":100102,"success":false,"msg":"数据更新失败","data":null}
    2019-02-21 22:51:08.140 INFO 80575 --- [nio-8080-exec-1] net.dreamlu.mica.logger.RequestLogAspect.aroundApi:141 : <=== GET: /test.json (30 ms)

微信公众号

如梦技术

精彩内容每日推荐!!!