I am using LUMEN framework.
I want to log or write all those errors which appears in console or terminal to a log file. So that I can see what errors are appearing in the process.
Currently I am running my LUMEN server using this command:
nohup php artisan queue:work --daemon & ?
So how can I get all those error in a log file?
Example errors I want to log:
[Mon Jul 6 13:39:12 2015] 127.0.0.1:36615 [500]: /v1/user/fetchUser/ -
Class 'App\Http\Controllers\V1\UserController' not found in /opt/lampp/htdocs/api/app/Http/Controllers/V1/ArticleController.php on line 504
[Tue Jul 7 11:11:59 2015] 127.0.0.1:37774 [500]: /v1/user/fetchUsers/
You can redirect the output to a file like this:
nohup php artisan queue:work --daemon > ./queue_worker.log &
To save the terminal output to one file and errors to another:
nohup php artisan queue:work --daemon > output.log 2> errors.log &
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With