/** * Get the singleton instance of this class and enable writing at shutdown. * * @return Kohana_Log */ public static function instance() { if (self::$_instance === NULL) { // Create a new instance self::$_instance = new self(); // Write the logs at shutdown register_shutdown_function(array(self::$_instance, 'write')); } return self::$_instance; }