【问题标题】:I need to debug laravel 5.4 webservice code while it called from android application我需要在从 android 应用程序调用时调试 laravel 5.4 webservice 代码
【发布时间】:2017-05-09 19:47:13
【问题描述】:

当我使用 laravel 5.4 从 android 应用程序调用它时,我需要调试我的 PHP Web 服务代码。因此,当移动应用程序向我的 Web API 发送 POST 请求时,我需要检查 post 数组以找出来自 android 应用程序的数据的形状,所以如果有任何方法可以做到这一点

【问题讨论】:

    标签: php laravel web-services debugging


    【解决方案1】:

    你可以使用 Laravel 日志服务https://laravel.com/docs/5.1/errors#logging

    喜欢

    Public function store(Request $request) { 
      Log::debug($request->all()); 
    }
    

    如果你愿意,你可以连接一些额外的信息。

    【讨论】:

    • 感谢您的关注
    【解决方案2】:

    你可以阅读这个给定的链接 https://laravel.com/docs/5.4/errors

    /**
     * Report or log an exception.
     *
     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
     *
     * @param  \Exception  $exception
     * @return void
     */
    public function report(Exception $exception)
    {
        if ($exception instanceof CustomException) {
            //
        }
    
        return parent::report($exception);
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多