LoginSignup
0
0

Laravel Homesteadでnginxのaccess.logを有効にする方法

Posted at

Laravel Homesteadを開発環境として使っている。

Laravelが動作する仮想環境をカンタンに構築できる優れものだ。

が、デフォルトでaccess.logがoffになっていて ログの追跡ができない。

[1753][scripts]$pwd
/Users/myname/Homestead/scripts

[1753][scripts]$grep access_log * -r | grep -v location | awk {'print $1'} | tr -d : | sort | uniq
site-types/cakephp3.sh
site-types/elgg.sh
site-types/fastadmin.sh
site-types/frontcontroller.sh
site-types/laravel.sh
site-types/modx.sh
site-types/phalcon.sh
site-types/pimcore.sh
site-types/proxy.sh
site-types/silverstripe.sh
site-types/spa.sh
site-types/statamic.sh
site-types/symfony2.sh
site-types/symfony4.sh
site-types/thinkphp.sh
site-types/umi.sh
site-types/wordpress.sh
site-types/yii.sh
site-types/zf.sh
[1753][scripts]$subl grep access_log * -r | grep -v location | a1 | sort | uniq

Homesteadのscriptsディレクトリ以下に設定元のファイルがあるようだ。
このファイルの

access_log off;

の部分を

access_log /var/log/nginx/access.log;

に変えてしまう。

homestead up --provision

を実行して確認すると

/etc/nginx/sites-enabled

ディレクトリ以下のconfファイルの

access_log /var/log/nginx/access.log;

になっていた。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0