Detect and attempt to recover from json_encode errors triggered by
strings containing invalid UTF-8 sequences. Recovery will only be
attempted when encoding strings or arrays. If recovery fails then
a RuntimeException will be thrown.
The recovery process will convert invalid UTF-8 codepoints as though the
input string was encoded using the ISO-8859-15 character encoding. This
conversion may result in incorrect string output if the original
encoding was not ISO-8859-15, but it will be a valid UTF-8 string.
Closes#545
Introduce a new `useMicrosecondTimestamps()` method to Logger that
allows runtime selection of whether or not to create microsecond
resolution timestamps for log records.
Generating microsecond resolution timestamps by calling
`microtime(true)`, formatting the result via `sprintf()` and then
parsing the resulting string via `DateTime::createFromFormat` can incur
a measurable runtime overhead vs simple usage of `new DateTime` to
capture a second resolution timestamp in systems which generate a large
number of log events.
The default behavior of generating high precision timestamps remains the
same, but may be changed in a future release. Users requiring high
precision timestamps are encouraged to explicitly call
`Monolog\Logger::useMicrosecondTimestamps(true)` in their setup code.
Closes#657
Protect against syntax compatibility issues such as the non-5.3
compatible array syntax corrected in 5785a9a by running a linter during
Travis CI testing for pull requests.
Closes#655
Since the code does not need neither the 'object' not 'args' keys from backtrace, we can save some memory by not requesting them.
I have a better idea planned too: first attempt getting the trace with limited back trace (limit to only about 5 results), and get the full one only if those were not enough
According to slack documentation (https://api.slack.com/docs/attachments), an attachment may have a title and a text. The log message and title should use these fields. One of the benefits of using these two properties instead of adding a field is that it's shortened (with a "show more" button) and expandable by slack. It adds a bit of hierarchy in the attachement. Message is the content. Extra and context are additional fields.