Sentry client for Mojolicious
$self->plugin('GetSentry', {
sentry_dsn => '...',
log_levels => ['error', 'fatal'],
tags_context => sub {
my ($plugin, $controller) = @_;
$plugin->raven->merge_tags(
account => $controller->current_user->account_id,
);
},
user_context => {
my ($plugin, $controller) = @_;
$plugin->raven->add_context(
$plugin->raven->user_context(
id => 1,
ip_address => '10.10.10.1',
)
);
},
request_context => {
my ($plugin, $controller) = @_;
$plugin->raven->add_context(
$plugin->raven->request_context('https://custom.domain/profile', method => 'GET', headers => { ... });
);
},
});
tags_context
- nothing is captured by defaultuser_context
- this plugin is trying to capture theuser id
and theip address
request_context
- this plugin is trying to capture theurl
,request method
and theheaders