phpmyadmin 为什么自定义标记的哨兵是不工作在laravel 8?

wvt8vs2t  于 2022-11-09  发布在  PHP
关注(0)|答案(1)|浏览(116)

我做了中间件设置登录用户的自定义标记,我想自定义事件ID中的标记用于性能监控。但这是不工作的,我我错过了什么??需要帮助...

<?php
namespace App\Http\Middleware;
use Auth;
use Closure;
use Sentry\State\Scope;

class SentryUser
{
    /**
     * Handle an incoming request.
     *
     * @param \Illuminate\Http\Request $request
     * @param \Closure                 $next
     *
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if(Auth::check() && app()->bound('sentry'))
        {
            \Sentry\configureScope(function (Scope $scope): void {
                $scope->setTag([
                    'id'    => Auth::user()->id,
                    'email' => Auth::user()->email,
                    'name'  => Auth::user()->name,
                ]);
            });
        }
        return $next($request);
    }
}
v1uwarro

v1uwarro1#

您是否尝试过setTags而不是setTag?

相关问题