Tag Info

New answers tagged

0

At my current company we have a similar setup: public facing websites, a few API's for partners, and a whole bunch of background tasks and services. One thing I pushed for when I joined the team several years back was to log everything to one database table. Skeptical? Yes, the DBA was too. I convinced him :) Yes, we had to be careful of hampering the ...


4

Normally you view the logs independently. Too much log is a real problem. There is almost no reason to view an interleaved log. If you really need to log an "action" through all the services have them write to a central log syslog is a great example apache writes to one log mysql to another, and there's usually never a reason to interleave them. Your ...


0

I think past tense is a safer bet. In your example: 1) "Could not acquire connection from DataSource" - an attempt was made, failed, situation could've changed since then. 2) "Can not acquire connection from DataSource" - an attempt was made, failed, it's 100% certain that situation is still the same. Also which tense would you pick for a timeout error? ...


5

I like to use present tense when the error/exception-generating code is the "root cause" of the problem, and past tense when I'm merely repackaging an error/exception from a lower layer of code. For example, when our frontend makes a request to our backend, the backend may return an error message "Cannot connect to database", and the frontend will throw ...


2

Anything that is worth printing at all is worth printing to the logs, since the whole point of logs is to record as much detail as possible about what happened during execution. As with any other program, by default the user should see only a small subset of the output that's likely to be useful and relevant to him. Due to the nature of your program, you ...


2

The fact that you are writing a console application doesn't change good UI practices. Your business logic should be distinct from your UI. The business logic performs the operations and indicates what might have gone wrong. The UI decided how that should be displayed. If there is information that is useful for tracking the execution of the application ...



Top 50 recent answers are included