twine-net / laravel-raven

Sentry (Raven) error monitoring for Laravel 4 & 5 with send in background
17 stars 2 forks source link

Logger tag #7

Closed tremby closed 9 years ago

tremby commented 9 years ago

I'm seeing the tag logger: local in my test errors. I can't tell if that's the environment (I am in the 'local' environment right now), but if it is it seems an odd place to put it if so. I would have expected the logger tag to be php or raven or laravel-raven or similar.

pulkitjalan commented 9 years ago

Strange, i'm not seeing the same thing in my env...

Can you send a copy of your config please so I can test.

pulkitjalan commented 9 years ago

screen shot 2015-04-13 at 22 55 47

tremby commented 9 years ago

Sure, current configuration looks like this (L4 branch):

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Enable raven logger
    |--------------------------------------------------------------------------
    |
    | Enable raven logger or not
    |
    */
    'enabled' => true,//!Config::get('app.debug'),

    /*
    |--------------------------------------------------------------------------
    | Raven DSN
    |--------------------------------------------------------------------------
    |
    | Your project's DSN, found under 'API Keys' in your project's settings.
    |
    */

    'dsn' => '**',
    'dsn_public' => '**',

    /*
    |--------------------------------------------------------------------------
    | Log Level
    |--------------------------------------------------------------------------
    |
    | Log level at which to log to Sentry. Default `error`.
    |
    | Available: 'debug', 'info', 'notice', 'warning', 'error',
    |            'critical', 'alert', 'emergency'
    |
    */

    'level' => 'error',

    /*
    |--------------------------------------------------------------------------
    | Queue connection
    |--------------------------------------------------------------------------
    |
    | Choose a custom queue connection to use from your config/queue.php
    |
    | Defaults to the default connection and queue from config/queue.php
    |
    */

    //'queue' => [
    //    'connection' => '',
    //    'queue' => ''
    //],

    /*
    |--------------------------------------------------------------------------
    | Monolog
    |--------------------------------------------------------------------------
    |
    | Customise the Monolog Raven handler.
    |
    */

    'monolog' => [

        /*
        |--------------------------------------------------------------------------
        | Processors
        |--------------------------------------------------------------------------
        |
        | Set extra data on every log made to Sentry.
        | Monolog has a number of built-in processors which you can find here:
        |
        | https://github.com/Seldaek/monolog/blob/master/README.mdown#processors
        |
        */

        'processors' => [
            // Current user status
            function ($record) {
                if ($user = Auth::user()) {
                    $record['context']['user'] = $user->toArray();
                } else {
                    $record['context']['user'] = ['id' => null];
                }
                return $record;
            },
        ],

    ],

    /*
    |--------------------------------------------------------------------------
    | Raven Configuration
    |--------------------------------------------------------------------------
    |
    | Any values below will be passed directly as configuration to the Raven
    | instance. For more information about the possible values check
    | out: https://github.com/getsentry/raven-php
    |
    | Example: "name", "tags", "trace", "timeout", "exclude", "extra", ...
    |
    */

    'options' => [
        'tags' => [
            /* 'environment' => App::environment(), */
            'version' => VersionHelper::getVersion(),
        ],
    ],

];

Very little is changed from your default configuration file. I get the same logger: local tag whether I am setting tags or that whole paragraph is commented out.

pulkitjalan commented 9 years ago

Fixed on 1.1.1 and dev-master