Giter Site home page Giter Site logo

nette-sentry's Introduction

Nette Sentry

Build Status

Tracy logger extension capable of logging messages and errors to Sentry.

Note: If you have debug mode enabled in your application, logger will only send \Tracy\Debugger::log() messages to sentry. Any exception ending with Tracy's blue screen is not going to be logged as you can see the exception details directly.

Installation

Install package via Composer:

composer require rootpd/nette-sentry

Configuration

Enable and configure the extension in Nette config file:

extensions:
	# ...
	sentry: Rootpd\NetteSentry\DI\SentryExtension

sentry:
    dsn: https://[email protected]/3 # required
    environment: production # optional, defaults to "local"
    user_fields: # optional, defaults to empty array; Nette's identity ID is being sent automatically
        - email
    session_sections: # optional, list of session sections to track
        - mySection
    priority_mapping:
        mypriority: warning

Priority-Severity mapping

Sometimes you might need to use custom priority when logging the error in Nette:

\Tracy\Debugger::log('foo', 'mypriority');

Sentry only allows strict set of severities. By default any message with unknown (non-standard) severity is not being logged.

You can map your custom priority to Sentry's severity in config by using priority_mapping as shown in the example.

The allowed set of Sentry severities can be checked in Sentry's PHP repository.

Usage

Once enabled as extension, you can continue to throw exceptions without any change. To log message please use \Tracy\Debugger::log() method.

nette-sentry's People

Contributors

markoph avatar martenb avatar rootpd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nette-sentry's Issues

It causes session id to be different for every request

I have a problem with this extension. It causes that I can't login to my web app. I was trying to figure it out, I discovered, that session id is different for every request, this extension somehow causes it, so the session is being forgotten after every request. When I comment out this extension in neon file, everything works as usual.
There are no PHP errors in any log folder. I use the latest stable Nette and PHP 7.4.
I don't know how to describe this problem more. I will try to explore your code and will get back at you if I discover something.
Otherwise it works, it sends messages to our Sentry.
But only causes described session mess.
Can you help me somehow? Can I provide more info?

PHP 8.0.0 Compatibility

After running composer update in a nette project with PHP 8.0.0, I've got the following error:
- rootpd/nette-sentry is locked to version 1.3.0 and an update of this package was not requested. - rootpd/nette-sentry 1.3.0 requires php ^7.2 -> your php version (8.0; overridden via config.platform, actual: 7.4.11) does not satisfy that requirement.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.