1
- **************************
1
+ ##########################
2
2
Debugging Your Application
3
- **************************
3
+ ##########################
4
4
5
5
.. contents ::
6
6
:local:
7
7
:depth: 2
8
8
9
- ================
10
- Replace var_dump
11
- ================
9
+ *************
10
+ Checking Logs
11
+ *************
12
12
13
- While using XDebug and a good IDE can be indispensable to debug your application, sometimes a quick ``var_dump() `` is
14
- all you need. CodeIgniter makes that even better by bundling in the excellent `Kint <https://kint-php.github.io/kint/ >`_
15
- debugging tool for PHP. This goes way beyond your usual tool, providing many alternate pieces of data, like formatting
16
- timestamps into recognizable dates, showing you hexcodes as colors, display array data like a table for easy reading,
17
- and much, much more.
13
+ .. _codeigniter-error-logs :
14
+
15
+ CodeIgniter Error Logs
16
+ ======================
17
+
18
+ CodeIgniter logs error messages, according to the settings in **app/Config/Logger.php **.
19
+
20
+ The default configuration has daily log files stored in **writable/logs **.
21
+ It would be a good idea to check them if things aren't working the way you expect!
22
+
23
+ You can adjust the error threshold to see more or fewer messages. See
24
+ :ref: `Logging <logging-configuration >` for details.
25
+
26
+ Logging All SQL Queries
27
+ =======================
28
+
29
+ All SQL queries issued by CodeIgniter can be logged.
30
+ See :ref: `Database Events <database-events-dbquery >` for details.
31
+
32
+ ********************
33
+ Replacing var_dump()
34
+ ********************
35
+
36
+ While using Xdebug and a good IDE can be indispensable to debug your application,
37
+ sometimes a quick ``var_dump() `` is all you need. CodeIgniter makes that even
38
+ better by bundling in the excellent `Kint <https://kint-php.github.io/kint/ >`_
39
+ debugging tool for PHP.
40
+
41
+ This goes way beyond your usual tool, providing many alternate pieces of data,
42
+ like formatting timestamps into recognizable dates, showing you hexcodes as colors,
43
+ display array data like a table for easy reading, and much, much more.
18
44
19
45
Enabling Kint
20
46
=============
@@ -33,6 +59,7 @@ The ``d()`` method dumps all of the data it knows about the contents passed as t
33
59
allows the script to continue executing:
34
60
35
61
.. literalinclude :: debugging/001.php
62
+ :lines: 2-
36
63
37
64
dd()
38
65
----
@@ -45,14 +72,15 @@ trace()
45
72
This provides a backtrace to the current execution point, with Kint's own unique spin:
46
73
47
74
.. literalinclude :: debugging/002.php
75
+ :lines: 2-
48
76
49
77
For more information, see `Kint's page <https://kint-php.github.io/kint// >`_.
50
78
51
79
.. _the-debug-toolbar :
52
80
53
- =================
81
+ *****************
54
82
The Debug Toolbar
55
- =================
83
+ *****************
56
84
57
85
The Debug Toolbar provides at-a-glance information about the current page request, including benchmark results,
58
86
queries you have run, request and response data, and more. This can all prove very useful during development
0 commit comments