|
1 |
| -# Errors & Logging |
| 1 | +# Hatalar ve Günlüğe Ekleme |
2 | 2 |
|
3 |
| -- [Error Detail](#error-detail) |
4 |
| -- [Handling Errors](#handling-errors) |
5 |
| -- [HTTP Exceptions](#http-exceptions) |
6 |
| -- [Handling 404 Errors](#handling-404-errors) |
7 |
| -- [Logging](#logging) |
| 3 | +- [Hata Ayrıntısı](#error-detail) |
| 4 | +- [Hataların İşlenmesi](#handling-errors) |
| 5 | +- [HTTP İstisnaları](#http-exceptions) |
| 6 | +- [404 Hatalarının İşlenmesi](#handling-404-errors) |
| 7 | +- [Günlüğe Ekleme](#logging) |
8 | 8 |
|
9 | 9 | <a name="error-detail"></a>
|
10 |
| -## Error Detail |
| 10 | +## Hata Ayrıntısı |
11 | 11 |
|
12 |
| -By default, error detail is enabled for your application. This means that when an error occurs you will be shown an error page with a detailed stack trace and error message. You may turn off error details by setting the `debug` option in your `app/config/app.php` file to `false`. **It is strongly recommended that you turn off error detail in a production environment.** |
| 12 | +Ön tanımlı olarak hata ayrıntısı uygulamanızda etkindir. Yani bir hata oluştuğu zaman ayrıntılı bir sorun listesi ve hata iletisi gösterebileceksiniz. `app/config/app.php` dosyanızdaki `debug` seçeneğini `false` ayarlayarak hata ayrıntılarını devre dışı bırakabilirsiniz. **Bir üretim ortamında hata ayrıntılarını devre dışı bırakmanız kuvvetle önerilir.** |
13 | 13 |
|
14 | 14 | <a name="handling-errors"></a>
|
15 |
| -## Handling Errors |
| 15 | +## Hataların İşlenmesi |
16 | 16 |
|
17 |
| -By default, the `app/start/global.php` file contains an error handler for all exceptions: |
| 17 | +Ön tanımlı olarak, `app/start/global.php` dosyasında tüm istisnalar için bir hata işleyici bulunmaktadır: |
18 | 18 |
|
19 | 19 | App::error(function(Exception $exception)
|
20 | 20 | {
|
21 | 21 | Log::error($exception);
|
22 | 22 | });
|
23 | 23 |
|
24 |
| -This is the most basic error handler. However, you may specify more handlers if needed. Handlers are called based on the type-hint of the Exception they handle. For example, you may create a handler that only handles `RuntimeException` instances: |
| 24 | +En temel hata işleyici budur. Ama siz gerektiği kadar işleyici belirleyebilirsiniz. İşleyicilere işledikleri İstisnaların tipine işaret eden isimler verilir. Örneğin, sadece `RuntimeException` olgularını işleyen bir işleyici oluşturabilirsiniz: |
25 | 25 |
|
26 | 26 | App::error(function(RuntimeException $exception)
|
27 | 27 | {
|
28 |
| - // Handle the exception... |
| 28 | + // İstisnayı işle... |
29 | 29 | });
|
30 | 30 |
|
31 |
| -If an exception handler returns a response, that response will be sent to the browser and no other error handlers will be called: |
| 31 | +Bir istisna işleyicisinin bir cevap döndürmesi halinde, bu cevap tarayıcıya gönderilecek ve başka bir hata işleyici çağrılmayacaktır: |
32 | 32 |
|
33 | 33 | App::error(function(InvalidUserException $exception)
|
34 | 34 | {
|
35 | 35 | Log::error($exception);
|
36 | 36 |
|
37 |
| - return 'Sorry! Something is wrong with this account!'; |
| 37 | + return 'Maalesef bu hesapla ilgili yanlış bir şeyler var!'; |
38 | 38 | });
|
39 | 39 |
|
40 |
| -To listen for PHP fatal errors, you may use the `App::fatal` method: |
| 40 | +PHP'nin fatal hatalarını izlemek için, `App::fatal` metodunu kullanabilirsiniz: |
41 | 41 |
|
42 | 42 | App::fatal(function($exception)
|
43 | 43 | {
|
44 | 44 | //
|
45 | 45 | });
|
46 | 46 |
|
47 | 47 | <a name="http-exceptions"></a>
|
48 |
| -## HTTP Exceptions |
| 48 | +## HTTP İstisnaları |
49 | 49 |
|
50 |
| -Exceptions in respect to HTTP, refer to errors that may occur during a client request. This may be a page not found error (404), an unauthorized error (401) or even a generated 500 error. In order to return such a response, use the following: |
| 50 | +HTTP istisnaları bir istemci isteği sırasında oluşabilecek hatalar demektir. Bu bir sayfa bulunamadı hatası (404), bir yetkisizlik hatası (401) hatta genel 500 hatası olabilir. Böyle bir cevap döndürmek için aşağıdaki biçimi kullanın: |
51 | 51 |
|
52 |
| - App::abort(404, 'Page not found'); |
| 52 | + App::abort(404, 'Sayfa bulunamadı'); |
53 | 53 |
|
54 |
| -The first argument, is the HTTP status code, with the following being a custom message you'd like to show with the error. |
| 54 | +Buradaki ilk parametre HTTP durum kodu, ikinci parametre ise bu hata durumunda göstermek istediğiniz özel bir mesajdır. |
55 | 55 |
|
56 |
| -In order to raise a 401 Unauthorized exception, just do the following: |
| 56 | +401 Yetkisizlik istisnası çıkarmak için tek yapacağınız şudur: |
57 | 57 |
|
58 |
| - App::abort(401, 'You are not authorized.'); |
| 58 | + App::abort(401, 'Yetkili değilsiniz.'); |
59 | 59 |
|
60 |
| -These exceptions can be executed at any time during the request's lifecycle. |
| 60 | +Bu istisnalar, isteğin yaşam döngüsü boyunca her an çalışabilecektir. |
61 | 61 |
|
62 | 62 | <a name="handling-404-errors"></a>
|
63 |
| -## Handling 404 Errors |
| 63 | +## 404 Hatalarının İşlenmesi |
64 | 64 |
|
65 |
| -You may register an error handler that handles all "404 Not Found" errors in your application, allowing you to return custom 404 error pages: |
| 65 | +Uygulamanızdaki tüm "404 Not Found" hatalarını işleyerek özel 404 hata hata sayfaları döndürmenize imkan veren bir hata işleyici kaydı yapabilirsiniz: |
66 | 66 |
|
67 | 67 | App::missing(function($exception)
|
68 | 68 | {
|
69 | 69 | return Response::view('errors.missing', array(), 404);
|
70 | 70 | });
|
71 | 71 |
|
72 | 72 | <a name="logging"></a>
|
73 |
| -## Logging |
| 73 | +## Günlüğe Ekleme |
74 | 74 |
|
75 |
| -The Laravel logging facilities provide a simple layer on top of the powerful [Monolog](http://github.com/seldaek/monolog). By default, Laravel is configured to create daily log files for your application, and these files are stored in `app/storage/logs`. You may write information to these logs like so: |
| 75 | +Laravel'in günlüğe ekleme imkanlanları güçlü [Monolog](http://github.com/seldaek/monolog) üstünde basit bir katman sağlar. Laravel, ön tanımlı olarak uygulamanız için günlük dosyaları oluşturacak şekilde yapılandırılmıştır ve bu dosyalar `app/storage/logs` içinde tutulmaktadır. Bu dosyalara aşağıdakilere benzer şekilde bilgi yazabilirsiniz: |
76 | 76 |
|
77 |
| - Log::info('This is some useful information.'); |
| 77 | + Log::info('İşte bu yararlı bir bilgidir.'); |
78 | 78 |
|
79 |
| - Log::warning('Something could be going wrong.'); |
| 79 | + Log::warning('Yanlış giden bir şeyler olabilir.'); |
80 | 80 |
|
81 |
| - Log::error('Something is really going wrong.'); |
| 81 | + Log::error('Gerçekten yanlış giden bir şey var.'); |
82 | 82 |
|
83 |
| -The logger provides the seven logging levels defined in [RFC 5424](http://tools.ietf.org/html/rfc5424): **debug**, **info**, **notice**, **warning**, **error**, **critical**, and **alert**. |
| 83 | +Günlük tutucu, [RFC 5424](http://tools.ietf.org/html/rfc5424)'de tanımlanmış yedi günlük ekleme düzeyi sağlamaktadır: **debug**, **info**, **notice**, **warning**, **error**, **critical** ve **alert**. |
84 | 84 |
|
85 |
| -Monolog has a variety of additional handlers you may use for logging. If needed, you may access the underlying Monolog instance being used by Laravel: |
| 85 | +Monolog, günlüğe ekleme için kullanabileceğiniz bir takım başka işleyicilere de sahiptir. Gerektiğinde, Laravel tarafından kullanılan Monolog olgusuna şu şekilde ulaşabilirsiniz: |
86 | 86 |
|
87 | 87 | $monolog = Log::getMonolog();
|
88 | 88 |
|
89 |
| -You may also register an event to catch all messages passed to the log: |
| 89 | +Ayrıca, günlüğe geçirilen tüm mesajları yakalamak için bir olay kaydı da yapabilirsiniz: |
90 | 90 |
|
91 |
| -**Registering A Log Listener** |
| 91 | +**Bir günlük izleyici kaydı yapılması** |
92 | 92 |
|
93 | 93 | Log::listen(function($level, $message, $context)
|
94 | 94 | {
|
|
0 commit comments