Fixes #3101: Improved handling of log target failures

This one is to fix #3101, many debug toolbar failures and improve logging in general. It will now skip target and log reason instead of going into infinite cycle.
Well, not really. For example, we have following targets:

```
file
email
db
```

If `email` fails then `file` will have both original message and message about `email` failure while `db` will have only `email` failure.