Base solution for your next web application
Open Closed

Log file in .Net Core/Angular project #4336


User avatar
0
BobIngham created

Where is the log file in the .Net Core/Angular project? log4net.config points to App_Data/Logs/Logs.txt but I can find no such folder or file. When I intentionally throw an error on the server the following is returned to the client.

{
    code: 0,
    message: "An internal error occurred during your request!",
    details: null,
    validationErrors: null
}

My only option seems to be to write try-catch blocks but how do I find exceptions after deployment? I have tried setting the level to ALL in log4net.config but I am still only able to capture errors through try-catch and have no log file to refer to. Help would be most appreciated.


6 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    Check your Web.Host project.

  • User Avatar
    0
    BobIngham created

    Hi Aaron, Thanks for getting back.... That's where I was checking, I cannot see what I'm missing... [attachment=0:29xr8kwp]Capture.PNG[/attachment:29xr8kwp]

  • User Avatar
    0
    aaron created
    Support Team

    Use your File Explorer, not Visual Studio.

  • User Avatar
    0
    BobIngham created

    Hi Aaron, Already tried that... [attachment=0:12yoyev5]Capture.PNG[/attachment:12yoyev5]

  • User Avatar
    0
    BobIngham created

    For anyone else who can't find the log file in a .Net Core/Angular project it is here: [attachment=0:fawg30kq]Capture.PNG[/attachment:fawg30kq] In the bin/debug/net461/App_data/Logs folder which is not part of the project so a solution-wide search will not find it. The current log file is locked when the solution is working so I'm not sure how you would go about retrieving current errors in a production environment?

  • User Avatar
    0
    aaron created
    Support Team

    The current log file is locked when the solution is working so I'm not sure how you would go about retrieving current errors in a production environment?

    As mentioned, use your File Explorer.