Click here to Skip to main content
15,897,371 members

Survey Results

How do you log errors in your applications?

Survey period: 29 Jan 2018 to 5 Feb 2018

Knowing you have a problem is the first step in fixing it.

OptionVotes% 
I log to a third party service (eg errlog.io)1148.86
I log to our own logging service26420.51
I log errors to syslog or the native OS logging system18814.61
I log errors to a database34626.88
I log errors to a file63449.26
I log errors via a messaging service such as email, HipChat etc1259.71
I log errors using other methods917.07
I don't log errors in my applications35127.27
Errors? My applications don't produce errors!947.30
Respondents were allowed to choose more than one answer; totals may not add up to 100%



 
GeneralOwn Log file always rocks...! Pin
koolprasad200328-Jan-18 19:38
professionalkoolprasad200328-Jan-18 19:38 
GeneralRe: Own Log file always rocks...! Pin
theoldfool30-Jan-18 1:41
professionaltheoldfool30-Jan-18 1:41 
GeneralIf only I knew... Pin
Sander Rossel28-Jan-18 19:37
professionalSander Rossel28-Jan-18 19:37 
GeneralRe: If only I knew... Pin
Mike (Prof. Chuck)29-Jan-18 0:33
professionalMike (Prof. Chuck)29-Jan-18 0:33 
GeneralRe: If only I knew... Pin
Sander Rossel29-Jan-18 0:38
professionalSander Rossel29-Jan-18 0:38 
GeneralRe: If only I knew... Pin
Mike (Prof. Chuck)29-Jan-18 1:19
professionalMike (Prof. Chuck)29-Jan-18 1:19 
GeneralRe: If only I knew... Pin
Sander Rossel29-Jan-18 6:13
professionalSander Rossel29-Jan-18 6:13 
GeneralRe: If only I knew... Pin
Mike (Prof. Chuck)29-Jan-18 7:40
professionalMike (Prof. Chuck)29-Jan-18 7:40 
"Entering xyz" is what we do too, at least for methods (in java, we do not log getter/setter).
This is the verbose level, retained for about 2 hours in the log.
Enough time for admin team, if the monitoring system raises an alert to snapshot the log and find the codepath, that is active.
Loggin method entries is nothing unusual as far as I can tell.
I personally don't see much sense in logging the exits, except for functions that return a value, but even in those cases we log the return value from the calling method, not inside the executing method, for a simple reason: There are MANY threads active, even with the threadId in the log, the log is easier to follow with lines like "(Methodname) received [HANDLE_INVALID] from [getWindowHandle]. Creating new window." than from an anonymous "Returning [HANDLE_INVALID]" out of a method that runs 50 times a second." (Just an example).
If you can't find anything in those logs, think about their structure.
In our production systems we have no other chance than those logs to find out whats going on, with 10k users online. The log density is extremely high.

But I can understand that writing logs can get boring very easily very fast. But we see it as part of our code quality. The structure of the log is extremely important for monitoring, so we have to keep the patterns straight with not much room for grammar. Some keywords, some values - everything for the monitor Smile | :)

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.