Questions tagged [exception-logging]

Writing error and exception information to a log file or database for review or research.

Exception-logging is the practice of writing error and exception information to a log file or database for review or research by debuggers, administrators, developers, etc.

39 questions
53
votes
4 answers

ELMAH - Exception Logging without having HttpContext

I tried this solution with Elmah.XmlFileErrorLog but I'm getting following exception System.ArgumentNullException was unhandled by user code Message="Value cannot be null.\r\nParameter name: context" Source="Elmah" ParamName="context" …
IsmailS
  • 10,797
  • 21
  • 82
  • 134
36
votes
2 answers

NLog LogException seems to ignore the exception

LogException or any of the derived functions like ErrorException etc. seem to totally ignore the exception parameter passed in. Am I missing a format attribute in my nlog.config file? I am using the boilerplate from the template that Nlog installs…
Rabbi
  • 4,622
  • 9
  • 35
  • 45
15
votes
3 answers

Elmah: How to get JSON HTTP request body from error report

I'm using Elmah to log exceptions. Elmah is great at logging request bodies if the request is a Form-based request (i.e. Content-Type: application/x-www-form-urlencoded), but with JSON based requests where the content type is application/json, the…
Johnny Oshika
  • 54,741
  • 40
  • 181
  • 275
14
votes
2 answers

How can I see a full log of exceptions in JAVA?

When I run some java program with a command java ExceptionTest , exceptions are sometimes omitted and looks like Exception in thread "main" java.lang.NoClassDefFoundError: aa/bb/DD at SOMEWHERE(unknown source) Caused by:…
aqjune
  • 478
  • 1
  • 3
  • 17
13
votes
4 answers

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…
pinale
  • 2,060
  • 6
  • 38
  • 72
13
votes
11 answers

General Exception Handling Strategy for .NET

I’m used to having try/catch blocks in every method. The reason for this is so that I can catch every exception at the point of infraction and log it. I understand, from my reading and conversations with others, that this isn’t a popular view. One…
Bob Horn
  • 33,387
  • 34
  • 113
  • 219
12
votes
2 answers

NLog Inner Exception Logging

I'm trying to log inner exception messages by using NLog. This is a piece of my NLog.config file:
Luis Teijon
  • 4,769
  • 7
  • 36
  • 57
7
votes
2 answers

Best practice of log custom exceptions in PHP

I have a custom exception (which is further extended in may other custom exceptions). My project requires log all the customExceptions (and all of its decendents) that occurs. I have a logger that can log customException (and anything else). One of…
7
votes
3 answers

Disable logging for one exception

I have a "Duplicate entry" exception, which logging SqlExceptionHelper. I need to disable logging only this exception. How can I do it?
Squeez
  • 919
  • 2
  • 12
  • 30
7
votes
2 answers

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

We are using custom error provided by asp.net config setting. In entire application (PL/BLL/DAL) we are not using any try catch. So for any exception in any layer application redirect user to custom error page set in custom error setting in config…
Paul
  • 457
  • 2
  • 11
  • 26
5
votes
3 answers

Problem with java.util.logging and Lock file

I have an application that scans a set of files. And this scanning take place parallely. I mean if I upload 5 files, five process will be created and start executing the job parallely. Now For logging the exceptions for the jobs running, there is…
Anish
4
votes
2 answers

How do you centralize ELMAH logs

At my works we produce websites like they are going out of fashion (ie a lot of sites per year) I want to install ELMAH on all of these as company practice and then log everything centrally for viewing by our developers. The process has to be really…
Doug
  • 6,460
  • 5
  • 59
  • 83
4
votes
0 answers

How to log ODataExceptions? ExceptionLogger isn't working

I am attempting to log exceptions within an OData v4 service built on WebApi 2.2. I am using NLog for logging. I created a simple ExceptionLogger (NLogExceptionLogger) class for this purpose. NLogExceptionLogger does log unhandled exceptions just…
Norm
  • 41
  • 1
4
votes
3 answers

How to catch and log all exceptions in an Apigility ZF2 application?

I want to build an error handling & logging mecanism into an Apigility Zend Framework 2 aplication and catch & log all exceptions. After some research I found a Stack Overflow answer with a solution, that seemed exactly to meet this requirements.…
automatix
  • 14,018
  • 26
  • 105
  • 230
3
votes
1 answer

Sonarcloud alerts "not enough arguments" when logging exceptions using SLF4J

I manage an open source project in Java and have about 20 places in my code where I log exceptions using the following pattern (slf4j version 1.7.30) private static final Logger logger = LoggerFactory.getLogger(); ... try { interfaces =…
Daniel Widdis
  • 8,424
  • 13
  • 41
  • 63
1
2 3