Base solution for your next web application
Open Closed

No exception in log file #10240


User avatar
1
adam.langley created

I am using AspNetZero Core+Angular.

I am receiving an "internal server error" response to an ajax call, but there is no output in the log file to figure out what is throwing the exception.

The HTTP response looks like this:

{"error":"Internal Server Error","result":null,"success":false}

And there are no errors in the Log.txt (there is Info logging, so I know logging is working).

I have writing an exception handler, but it never fires.

public class MyExceptionHandler : IEventHandler<AbpHandledExceptionData>, ITransientDependency
{
    public void HandleEvent(AbpHandledExceptionData eventData)
    {
        //TODO: Check eventData.Exception!
    }
}

I have tried overriding the exception filter which (I think) is producing the ajax wrapped exception response object, and injected it - but it also does not fire.

public class MyExceptionFilter : AbpExceptionFilter, ITransientDependency
{

    public MyExceptionFilter(IErrorInfoBuilder errorInfoBuilder, IAbpAspNetCoreConfiguration configuration)
        :base(errorInfoBuilder, configuration)
    {
    }

    protected override void HandleAndWrapException(ExceptionContext context, WrapResultAttribute wrapResultAttribute)
    {
        base.HandleAndWrapException(context, wrapResultAttribute);
    }

}

Where do I go from here?

Thanks


1 Answer(s)
  • User Avatar
    0
    musa.demir created

    Hi @adam.langley Can you please check your log level: https://github.com/aspnetzero/aspnet-zero-core/blob/3e78676acedafff49422c2ab9247a60accc0120e/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Host/log4net.config#L16

    Your log level can be one of the following: https://logging.apache.org/log4net/release/manual/introduction.html