Search code examples
c#asp.net-coreexceptionaspnetboilerplateexception-logging

How to get more detailed exception in ABP?


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?


Solution

  • Check error in Logs.txt.

    From the documentation on 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" />