Skip to content

Instantly share code, notes, and snippets.

@nojimage
Created July 17, 2014 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nojimage/564981bf35ecf41bca1f to your computer and use it in GitHub Desktop.
Save nojimage/564981bf35ecf41bca1f to your computer and use it in GitHub Desktop.
Laravelのものぐさログ設定
<?php
// snip ..
// ログのパーミッションはデフォルトで0644なので、cli経由、web経由でファイル名変えとく。
$logFile = PHP_SAPI . '.log';
Log::useFiles(storage_path('logs/debug-' . $logFile)); // こっちは全部のログレベルを書き込むログ
Log::useFiles(storage_path('logs/error-' . $logFile), 'warning'); // こっちはwarning以上を書き込むログ
@nojimage
Copy link
Author

パーミッション替えようと思うと、Handlerを直接インスタンス化するか、取り出して変更してまた入れてをしないとなので、ファイル名変えちゃう。

@nojimage
Copy link
Author

エラーだけ見たいこともあるかなと、ログ分けてみたけど要らないと思う。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment