App.php 791 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. *
  4. * @copyright ©2020 点小铺
  5. * @author hanj
  6. * @link: https://dyuit.com
  7. * Created by VSCode
  8. */
  9. namespace app\common\behavior;
  10. use think\Log;
  11. use think\Request;
  12. /**
  13. * 应用行为管理
  14. * Class App
  15. * @package app\common\behavior
  16. */
  17. class App
  18. {
  19. /**
  20. * 应用开始
  21. * @param $dispatch
  22. */
  23. public function appBegin($dispatch)
  24. {
  25. // 记录访问日志
  26. if (!config('app_debug')) {
  27. $request = Request::instance();
  28. Log::record('[ ROUTE ] ' . var_export($dispatch, true), 'begin');
  29. Log::record('[ HEADER ] ' . var_export($request->header(), true), 'begin');
  30. Log::record('[ PARAM ] ' . var_export($request->param(), true), 'begin');
  31. }
  32. }
  33. }