분야 "Debugging" tricks

console 로그와 웹 로그 분리하기
로그 설정을 daily로 하고, artisan command 등의 console 명령을 스케쥴링을 통하여 수행하는 경우 console 계정과 웹 계정의 차이로 인해 다음의 문제가 발생하는 경우가 있다. Failed to open stream:…
Submitted 7 years ago in Configuration, Debugging
5711
0
0
5.1
Laravel 5에서 로깅 설정 변경하기
Illuminate\Foundation\Bootstrap\ConfigureLogging 오버라이딩 bootstrap\ConfigureLogging.php 생성 <?php namespace Bootstrap; use Illuminate\Log\Writer; use Illuminate\Contracts\Foundation\Application; use…
Submitted 8 years ago in Debugging, Configuration
5125
0
0
Lumen에서 daily log 사용하기
Lumen에서는 storage/logs/lumen.log 하나의 파일에 로그가 기록된다. 로그에 대한 설정은 getMonologHandler에서 행해진다. Laravel\Lumen\Application ... /** * Register container bindings for the application. * * @return void */…
Submitted 8 years ago in Configuration, Lumen, Debugging
5933
0
0
로그 메시지에 회원 아이디, ip 등 원하는 정보 추가하기
사이트를 운영하면서 오류가 발생을 하면 로그 정보에 많이 의존하게 된다. 하지만 Laravel이 기본으로 제공하는 로그 메시지로는 디버깅이 많이 불편하다. 그래서 로그 메시지에 원하는…
Submitted 9 years ago in Debugging
3084
0
0
redis, logstash, elasticsearch, kibana를 이용해서 실시간 로그 모니터링 하기
웹서비스를 운영하다 보면 장애 탐지나 버그 수정 등 많은 경우 로그 정보에 의존해서 문제를 해결하게 된다. redis, logstash, elasticsearch, kibana의 조합을 사용하면 Laravel에서 남기는 로그의…
Submitted 9 years ago in Debugging, Configuration
6145
0
0
Eloquent 쿼리, 파일에 로그 남기기
Before you start with this create a file in your logs folder (eg : 'query.log') and grant laravel write access to it. Place the snippet in your '/app/start/local.php' file. (or routes.php or anywhere...) Access artisan from your console and type this $…
Submitted 9 years ago in Eloquent, Debugging
2620
0
0
php 내장 웹서버 실행하기
php는 5.4부터 웹서버를 내장하고 있다. 개발이나 간단한 테스트시 이 웹서버를 사용하면 편하다. Laravel에서는 php artisan serve을 이용해서 내장 웹서버를 실행할 수 있다. $ php artisan serve Laravel…
Submitted 9 years ago in Debugging, Testing
5561
0
0
DB의 모든 쿼리를 화면에 출력하기
Eloquent ORM이 어떤 마술을 부리는지 알고 싶을 때가 많다. Laravel의 이벤트 리스너를 사용하면 간단하게 어떤 쿼리가 생성되서 실행되는지 볼 수가 있습니다. // Display all SQL executed in Eloquent…
Submitted 9 years ago in Eloquent, Queries, Debugging
2875
0
0