- Tutorials
- Blog_tutorial_-_1
- Migration
- Blog_tutorial_-_2
- Book_titles
- Pagination
- Debugging_your_code
- Extending_cake
- Multiple_applications
- Sending_email
- Scaffolding_a_blog
- Sample_layout
- Image_gallery
- Dynamic-image
- Online_editor-fckeditor
- Using_cake_with_drupal
- Cake_with_smarty
- Testing_cake_apps
- Howto_use_rdauth
- Dynamic-menu
- Your_tutorial
- Creating_pdfs
- Creating_pdfs_easy
- Cake_on_ubuntu
- Hello_world
- Complex_model_validation_routines
- User_permissions
- Cake_under_iis
- Advanced_validation
- Sending_email_with_phpmailer
- Change_database_config
- Alternative_installation_locations
- Css_in_ajax
- Css_menus
- Flashing
- Alternate_advanced_validation
- Deep_cakephp
- I18n_v2
- Building_a_cakephp_site_part_-_1
- Loading_sql_with_prefixes
- Building_a_cakephp_site_part_-_2
- Creating_a_dragglable_element
- I18n
- Online_editor-xinha
- Image_gallery_2
- Cake_migrations
- Beginners_only
- Cake_under_iis_without_rewrite
- Acl-access-checking
- Simple_pagination_helper
- Ajax_sortable_list
- Building_a_web_wizard
- Url_rewrite_without_apache
- Duplicate_record_validation
- Litte_german_example
- Authentication_with_rdsimpleauth
- Simple_contextual_help
- Passing_named_parameters
- Advanced_validation
- Calendar_pagination
- Config_in_database
- How_to_toggle_expand-collapse_with_javascript
- Xampp_vhost_config_on_windows
- Time_helper_other_languages
- Routing_for_multilanguage
- How_to_implement_single_table_inheritance
- Thumbnails_with_phpthumb
- Syncronised_session_using_cakeamfphp
- Secure_logins_with_challenge_response
- Config_in_database_2
- Installing_on_macosx
- Tinymce_with_cake
- Persistent_data
- Functional_testing_cake_apps
- Getting_paths_right
Debugging Your Code
Cake has three standard debug levels, set by using the DEBUG constant in core.php (to be found in the “app\config” sub-folder) - set this to 0 for production use, 1 for debugging during development, 2 for debugging with SQL output and 3 for full debug with SQL, and dump of the current object. In version 0.10 level 1 is default (see source code comments in the file for the most recent details).
As well as this, Cake also has a global debug function. It outputs the passed variable in a readable format. If the debug level setting is 0 then nothing will be output.
$variable = array('one'=>1, 'two'=>2); debug( $variable );
produces
Array( 'one' => 1, 'two' => 2, )
As you can see, debug() is a very thin wrapper around print_r() in PHP.
Logging Errors
incomplete - this is a placeholder only - if you have any information please add it here! All classes inherit behaviour from the Object class, this class allows for errors to be logged to a log file.
function log ($msg, $type=LOG_ERROR)
Called as $this→log(’message to write to log file’)
LOG_ERROR types
- LOG_DEBUG defined in PHP. See http://ca3.php.net/syslog. Output will go in tmp/logs/debug.log
- LOG_ERROR defined in cake/libs/log.php. Output will go in tmp/logs/error.log
Location of Log Files
- ROOT
- app
- cake
- tmp
- logs
⇐your logs here
- vendors
By what I have seen in object.php and log.php, you can have two log files at the same time, error.log (default) and debug.log.