Add a setter method to allow changing the timezone used when creating
new log records. This provides a means to correct a behavioral change
introduced by 6cbdc04 where use of the PHP runtime default timezone
provided by `date_default_timezone_get()` was introduced. In most
environments the new default behavior is preferable, but if an
application allows the default timezone to vary between requests it
causes confusing log output.
Adds support for Hipchat's V2 API by way of setting the version flag. V1 paths
should remain unchanged. A setVersion() method is provided for convenience in case
one does not want to override all of the default parameters.
Swift_Message object is not created until right before the message is
sent, if it is sent at all. This prevents the expensive Swift_Mailer
autoloader from being invoked.
Swift_Mailer is now also required to run test suite
It wraps around another handler, and only passes on some messages
based on the provided sampling handler.
This was originally written for MediaWiki: https://gerrit.wikimedia.org/r/181346
Refs https://github.com/Seldaek/monolog/pull/474/files
The fix in the previous PR did not take into account that there might be object wrapped resources that would break json_encode, so the best solution would be normalizing those frames again.
@Seldaek Sorry for the inconvenience, but our graylog is still ramming up with those json_encode error messages.
With `React` or `Guzzle`, that register stream wrappers with PHP, the traces are treated as coming from internal functions with no line and file inside the frame. But they almost always contain resources as arguments, on which the `json_encode()` call will choke (probably this should be addressed in json_encode internally, since it is very easy to cast a resource to a string).
I added a test case proving the situation and a pretty basic recursive checker for resources which just casts them as a string into the frame again.