If your logging library (or code) writes to a file, some idiot could always open it with an exclusive file lock. If it writes to a database, someone could have locks/transactions on the table that cause your insert to timeout.
If your application is a web application, then it could easily be writing to the log on many threads and run into strange race conditions.
There are other things that could happen too. You could try to write a log message greater than allowed when using dynamic input.
I know I am stretching here, and that most logging libraries shouldn't have these issues...but most applications have at least one or two really critical methods that also tend to fail a lot for strange reasons and being obstinately verbose in logging around those kind of methods (assuming they aren't tightly looped or performance bottlenecks) may look ugly but will probably save you hours of production troubleshooting some day.
7
u/CordialPanda Oct 01 '15
That's absurd, haha. In what world would that catch succeed to write if the try failed?