asp.net-core - 如何在 ABP 中获得更详细的异常?

标签 asp.net-core aspnetboilerplate exception-logging

我创建了一个 CrudAppService。当我使用 swagger 调用它的动态 API 时,我得到一个通用的 500此描述错误:

{
  "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
}

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

最佳答案

检查 中的错误日志.txt .

来自 Logging 上的文档:

Configuration

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

...

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" />

关于asp.net-core - 如何在 ABP 中获得更详细的异常?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48050689/

相关文章:

quartz.net - 如何停止或暂停 Quartz 作业

dependency-injection - aspnetBoilerplate 中的模块是什么?

asp.net-web-api - 如何从 ASP.net 5 Web api 返回文件

c# - 网络核心 : Swashbuckle Set operationId Automatically on to Controller Action Method

angular - IdentityServer 外部身份验证提供程序 - 身份验证回调 - 重定向 - 400 错误请求

logging - NLog LogException 似乎忽略了异常

asp.net-4.0 - Asp.net 4.0 : How to get exception details in custom error page?

docker - docker 容器中的hangfire 无法正常工作黑屏访问仪表板 url

c# - ASP.NET Core 6 - 如何在不反序列化的情况下通过 MapPost() 获取 JSON 输入?

c# - Elmah:如何从错误报告中获取 JSON HTTP 请求正文