Closed srtfisher closed 10 years ago
This should already be possible, the client extends the default Raven client.
When time permits I want to add in better support for collecting automatically from Laravel.
On 4 Dec 2013, at 17:43, Sean Fisher notifications@github.com wrote:
I think it would a great addition to have the ability to add extra information to pass to Sentry from the Laravel provider. I would love to pass in user info, server name, environment etc.
Unless this is currently possible... Seems to be possible with the Raven PHP client.
— Reply to this email directly or view it on GitHub.
Thank you for building this, too. Made my life easier to add Sentry support to Laravel.
Would also be great to have the Log Level feature that you had for your laravel-sentry package put back into it.
Yeah working on that one. Someone raised that the other day.
Happy to accept pull requests :)
On 4 Dec 2013, at 18:04, Sean Fisher notifications@github.com wrote:
Would also be great to have the Log Level feature that you had for your laravel-sentry package put back into it.
— Reply to this email directly or view it on GitHub.
@rcrowe Better be working on that one! :D :+1: Practically I cannot use this package nor Sentry (unless installing the old package) as Sentry will soon be full of info level loggings as errors!
:+1: For automatic details!
I'll have this all fixed in the feature/0.2.0 branch which should be out shortly.
So log levels are now support.
There are 3 new helper functions:
Log::setUser()
- Set the logged in userLog::removeUser()
- Remove the user from logsLog::exception()
- Wrapper function to make things nicer when logging exceptions.If you need to set any custom extra context/tags etc you have access to the Raven client, like so:
App::make('log.sentry')->extra_context(...);
You can also pass extra context through the log methods which will be passed on to Sentry:
Log::error('message goes here', [
'foo' => 'bar'
]);
Overall, there is much better integration with Sentry now. Let me know if I can add anything else. Few more tests to write, then I'll merge and tag 0.2.0.
Think I'm going to remove Log::exception()
as there's complexities around (log level) that just aren't needed.
Instead I'll patch the log methods to react to receiving an Exception
object passed in.
Removed Log::exception
, now just use Log::error($exception, $context = array())
With Log::setUser
, is this something I can call in start.php
with Log::setUser(Auth::user())
?
I think it would a great addition to have the ability to add extra information to pass to Sentry from the Laravel provider. I would love to pass in user info, server name, environment etc.
Unless this is currently possible... Seems to be possible with the Raven PHP client.