php - Monolog get requested url and simple log on in Laravel 5 -
i have checked official repo of monolog , put below code, working great , getting response in slack. response verbose, how can simple response, without stack trace.
and suggested on doc have added $monolog->pushprocessor(new webprocessor($_server));
not giving information requested url , server.
class appserviceprovider extends serviceprovider { /** * bootstrap application services. * * @return void */ public function boot() { if ($this->app->environment('production')) { // logger $monolog = log::getmonolog(); // ********************************************************************************************** // have tried official webprocessor url, not giving me // ********************************************************************************************** $monolog->pushprocessor(new webprocessor($_server)); $monolog->pushprocessor(function ($record) { $record['extra']['session_id'] = cookie::get(config('session.cookie')); $record['extra']['request_id'] = session::get('request_id'); return $record; }); $slackhandler = new slackhandler(env('slack_token'), '#sss-sslogs', 'sss-log', true, ':warning:', logger::error); // ********************************************************************************************** // setup line formatter no luck // ********************************************************************************************** // default date format "y-m-d h:i:s" $dateformat = "y n j, g:i a"; // default output format "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n" $output = "%datetime% > %level_name% > %message% %context% %extra%\n"; // finally, create formatter $formatter = new lineformatter($output, $dateformat); $slackhandler->setformatter($formatter); $monolog->pushhandler($slackhandler); } }
above code giving me below response in slack channel
exception 'illuminate\database\eloquent\modelnotfoundexception' message 'no query results model [app\user].' in /home/vagrant/code/app/vendor/laravel/framework/src/illuminate/database/eloquent/builder.php:151 stack trace: #0 /home/vagrant/code/app/app/http/controllers/portfoliocontroller.php(30): illuminate\database\eloquent\builder->firstorfail() #1 [internal function]: app\http\controllers\porofilecontroller->show('users') #2 /home/vagrant/code/app/vendor/laravel/framework/src/illuminate/routing/controller.php(246): call_user_func_array(array, array) #3 /home/vagrant/code/app/vendor/laravel/framework/src/illuminate/routing/controllerdispatcher.php(162): illuminate\routing\controller->callaction('show', array) #4 /home/vagrant/code/app/vendor/laravel/framework/src/illuminate/routing/controllerdispatcher.php(107): illuminate\routing\controllerdispatcher->call(object(app\http\controllers\portfoliocontroller), object(illuminate\routing\route), 'show') #5 [internal function]: illuminate\routing\controllerdispatcher->illuminate\routing\{closure}(object(illuminate\http\request)) #6 /home/vagrant/code/app/vendor/laravel/framework/src/illuminate/pipeline/pipeline.php(141): call_user_func(object(closure), object(illuminate\http\request)) #7 [internal function]: illuminate\pipeline\pipeline->illuminate\pipeline\{closure}(object(illuminate\http\request)) #8 /home/vagrant/code/app/vendor/laravel/framework/src/illuminate/pipeline/pipeline.php(101): call_user_func(object(closure), object(illuminate\http\request)) #9 /home/vagrant/code/app/vendor/laravel/framework/src/illuminate/routing/controllerdispatcher.php(108): illuminate\pipeline\pipeline->then(object(closure)) #10 /home/vagrant/code/app/vendor/laravel/framework/src/illuminate/routing/controllerdispatcher.php(67): illuminate\routing\controllerdispatcher->callwithinstack(object(app\http\controllers\portfoliocontroller), object(i… level ---------------- error
where requested url , session data??
how can below part requested url
, not interested in stack trace:
exception 'illuminate\database\eloquent\modelnotfoundexception' message 'no query results model [app\user].' in /home/vagrant/code/app/vendor/laravel/framework/src/illuminate/database/eloquent/builder.php:151
Comments
Post a Comment