function setClientLog($data)
 {
     global $config_vars;
     if (!is_array($data) or count($data) == 0) {
         return FALSE;
     }
     ksort($data);
     $base_dir = $config_vars['path']['log'] . DIRECTORY_SEPARATOR . 'client' . DIRECTORY_SEPARATOR;
     $upload_time = time();
     Debug::Text('Setting Log Lines: ' . count($data), __FILE__, __LINE__, __METHOD__, 10);
     //Binary data could be coming in through this. Eric should Base64 encode his end
     //And Decode it here.
     //Log all data to log files based on station IDs. If no station id (ie: no probes plugged in)
     //Use IP address and send to a "generic" log.
     foreach ($data as $row_key => $row) {
         //Debug::Text('Row Key: '. $row_key .' Date/Time: '. TTDate::getDate('DATE+TIME', $row['epoch']) .' Verbosity: '. $row['verbosity'] .' Station ID: '. $row['station_id'] .' Text: '. $row['msg'], __FILE__, __LINE__, __METHOD__,10);
         if ($row['station_id'] == '') {
             $station_id = 'no_station_id';
         } else {
             $station_id = $row['station_id'];
         }
         $retarr[$station_id][] = '[' . TTDate::getDate('DATE+TIME', $row['epoch']) . '] (' . $row['verbosity'] . ') - ' . $row['msg'] . "\n";
     }
     foreach ($retarr as $station_id => $line_arr) {
         array_unshift($line_arr, '---------------- Data Uploaded By: ' . $_SERVER['REMOTE_ADDR'] . ' At: ' . TTDate::getDate('DATE+TIME', $upload_time) . ' ----------------' . "\n");
         Debug::Text('Station ID: ' . $station_id, __FILE__, __LINE__, __METHOD__, 10);
         if ($station_id != 'no_station_id') {
             //Get Company Short name for station_id
             $slf = new StationListFactory();
             $slf->getByStationID($station_id);
             if ($slf->getRecordCount() > 0) {
                 $s_obj = $slf->getCurrent();
                 $company_name = $s_obj->getCompanyObject()->getShortName();
                 //FIXME: Check to make sure the company is still active before proceeding.
             } else {
                 $company_name = 'no_company';
             }
             unset($slf, $s_obj);
         } else {
             $company_name = 'no_company';
         }
         $dir = $base_dir . preg_replace('/[^a-zA-Z0-9]/', '', escapeshellarg(trim($company_name))) . DIRECTORY_SEPARATOR;
         //Remove all non-alphanumeric chars.
         if (!file_exists($dir)) {
             mkdir($dir);
         }
         $file_name = $dir . $station_id;
         Debug::Text('Company Name: ' . $company_name . ' File Name: ' . $file_name, __FILE__, __LINE__, __METHOD__, 10);
         file_put_contents($file_name, $line_arr, FILE_APPEND);
         unset($company_name);
     }
     return TRUE;
 }