<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ## 如何使用自定義API日志 * 下面我們使用`blade-demo`中的一個API接口來測試下API日志 * 增加`@ApiLog`注解,代碼如下 ~~~ /** * 詳情 */ @ApiLog("Blog詳情") @GetMapping("/detail") @ApiOperation(value = "查看詳情", notes = "傳入主鍵", position = 1) public R<Blog> detail(@ApiParam(value = "主鍵值") @RequestParam Integer id) { Blog detail = service.getById(id); return R.data(detail); } ~~~ * 重啟服務后調用接口并查看數據庫日志,可以看到,詳細的日志信息都已經入庫了 ![](https://box.kancloud.cn/a38089e49f7d33ad5febfaa33f744f7c_1535x102.png) <br> ## 如何使用自定義通用日志 * 仍然找到上一小節提到的`blade-demo`中的API接口 * 注入`BladeLogger`類,并在`detail`接口內寫入邏輯,代碼如下 ~~~ @RestController @AllArgsConstructor @RequestMapping("blog") @Api(value = "用戶博客", tags = "博客接口") public class NoticeController extends BladeController implements CacheNames { private IBlogService service; private BladeLogger logger; /** * 詳情 */ @ApiLog("Blog詳情") @GetMapping("/detail") @ApiOperation(value = "查看詳情", notes = "傳入主鍵", position = 1) public R<Blog> detail(@ApiParam(value = "主鍵值") @RequestParam Integer id) { Blog detail = service.getById(id); logger.info("detail_test", JsonUtil.toJson(detail)); return R.data(detail); } } ~~~ * 重啟服務后調用接口并查看數據庫日志 * 調用后將會看到`blade_log_usual`已經有數據入庫了 ![](https://img.kancloud.cn/02/1e/021e3cabf70bdd4092a20a9e5d738fbc_2204x236.png) <br> ## 結尾語 為了保證日志系統的高可用,推薦將![](https://img.kancloud.cn/f4/01/f401909d21f82a898d4cbe9415f3bd98_422x114.png)這三張表單獨成一個庫,同時將 ![](https://box.kancloud.cn/fe5e5df1798be2b9d81af4b33e44dfb3_261x181.png)`blade-log` 服務部署多份,這樣就可以保證日志服務可長期穩定地提供保障
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看