WordPress -> Plugin Development -> Write to Debug.txt
<?
$file = ABSPATH.'wp-content/plugins/*PLUGIN-NAME*/debug.txt'; // Debug File
$current = file_get_contents($file); // Get Contents
$current .= "John Smith\n"; // Append new
file_put_contents($file, $current); // // Write the contents back to the file
?>