如何在 ABP 中获得更详细的异常? [英] How to get more detailed exception in ABP?

查看:37
本文介绍了如何在 ABP 中获得更详细的异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个 CrudAppService.当我使用 swagger 调用它的动态 API 时,我收到一个带有以下描述的通用 500 错误:

I created a CrudAppService. When I invoke its dynamic API by using swagger, I get a generic 500 error with this description:

{
  "result": null,
  "targetUrl": null,
  "success": false,
  "error": {
    "code": 0,
    "message": "An internal error occurred during your request!",
    "details": null,
    "validationErrors": null
  },
  "unAuthorizedRequest": false,
  "__abp": true
}

如何获得更详细的调试异常?有什么我必须启用的吗?

How can I get a more detailed exception to debug? Is there something I have to enable?

推荐答案

检查 Logs.txt 中的错误.

来自关于日志记录的文档:

当您从 ASP.NET 样板模板创建应用程序时,Log4Net 的所有配置都已完成.

Configuration

All configuration is done for Log4Net when you create your application from ASP.NET Boilerplate templates.

...

在应用程序的log4net.config文件中定义如下:

It's defined in the log4net.config file of the application as shown below:

<?xml version="1.0" encoding="utf-8" ?>
<log4net>
  <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender" >
    <file value="Logs/Logs.txt" />

这篇关于如何在 ABP 中获得更详细的异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆