Wikia/app — pull request #4340 by macbre (2014-07-31 12:08:08+00:00)
Title: WikiaLogger: add backtrace for errors ((PLATFORM-363))

@Wikia/platform-team / @nmonterroso

This PR adds a support for ``exception`` field in context that can be used to pass ``Exception`` class instance. This field will then be renamed to ``@exception`` and contain message and error code from the exception and backtrace array.

An example:

```php
wfGetDB(DB_SLAVE)->query('select * from foo')
```

```json
{"@timestamp":"2014-07-31T11:56:30.308522+00:00","@message":"DBError","@fields":{"db_name":"muppet","city_id":"831"},"@exception":{"class":"DBQueryError","message":"A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script\nQuery: select * from foo\nFunction: \nError: 1146 Table 'muppet.foo' doesn't exist (10.14.30.141)\n","file":"/usr/wikia/source/app/includes/db/Database.php:941","trace":["/usr/wikia/source/app/includes/db/Database.php:908","/usr/wikia/source/app/maintenance/eval.php(72) : eval()'d code:1","/usr/wikia/source/app/maintenance/eval.php:72"]},"@context":{"name":"muppet","server":"10.14.30.141","errno":1146,"err":"Table 'muppet.foo' doesn't exist (10.14.30.141)"}}
```