Skip to main content

Logging errors

Tuskfish has a very simple custom error logger class, \Tfish\Logger (TfLogger in Tuskfish v1). All it does is write error messages to a log file, which you will find in trust_path/libraries/tuskfish/log/tuskfish_log.txt.

For debugging purposes you can uncomment the following line to display errors on screen, but you should leave it commented out on a production site. 

// Debug only - comment OUT in production site to view errors on screen.
// echo '<p>' . print($message) . '</p>';

Logging can also be enabled by modifying the following code in trust_path/libraries/tuskfish/header.php:

// Set error reporting levels and custom error handler.
\ini_set('display_errors', '0'); // Needs to be set to 0 for production.
\ini_set('log_errors', '1');
\error_reporting(E_ALL);

Copyright, all rights reserved.

Related

Tuskfish CMS Developer Guide

This guide will give you an overview of the architecture of Tuskfish CMS, how to write code to perform common operations and how to extend the system to suit yourself. The guide accompanies the Tuskfish API documentation. Keep a copy handy as you read this guide. It is best to review links to the API where provided, as not every detail will be discussed in the text. This is the first version of the guide, so it is still a work in progress.