Updated code to use new Logging code in sihnon lib

This commit is contained in:
2011-04-24 10:40:14 +01:00
parent b896877591
commit dbaf4968ab
6 changed files with 90 additions and 16 deletions

View File

@@ -14,7 +14,7 @@ try {
$config = $main->config();
$log = $main->log();
$client = new Net_Gearman_Client('river.sihnon.net:4730');//$config->get('rips.job_servers'));
$client = new Net_Gearman_Client($config->get('rips.job_servers'));
$set = new Net_Gearman_Set();
// Retrieve a list of Created jobs
@@ -34,7 +34,7 @@ try {
// Start the job queue
$result = $client->runSet($set);
$log->info("Job queue completed");
RippingCluster_LogEntry::info($log, 'Job queue completed', 'batch');
} catch (RippingCluster_Exception $e) {
die("Uncaught Exception (" . get_class($e) . "): " . $e->getMessage() . "\n");
@@ -46,7 +46,7 @@ function gearman_complete($method, $handle, $result) {
$log = $main->log();
/*$log->info("Job Complete", $job->id());*/
$log->info("Job complete");
RippingCluster_LogEntry::info($log, 'Job complete', 'batch');
}
function gearman_fail($task) {
@@ -57,7 +57,7 @@ function gearman_fail($task) {
$job->updateStatus(RippingCluster_JobStatus::FAILED);
$log->info("Job Failed", $job->id());*/
$log->info("Job failed");
RippingCluster_LogEntry::info($log, 'Job failed', 'batch');
}

View File

@@ -4,8 +4,10 @@ $job_id = $this->request->get('id');
$job = RippingCluster_Job::fromId($job_id);
$this->smarty->assign('job', $job);
$client_log_entries = RippingCluster_ClientLogEntry::recentForJob($job_id, 30);
$worker_log_entries = RippingCluster_WorkerLogEntry::recentForJob($job_id, 30);
$log = RippingCluster_Main::instance()->log();
$client_log_entries = RippingCluster_LogEntry::recentEntriesByField($log, 'webui', 'job_id', $job_id, 'ctime', SihnonFramework_Log::ORDER_DESC, 30);
$worker_log_entries = RippingCluster_LogEntry::recentEntriesByField($log, 'worker', 'job_id', $job_id, 'ctime', SihnonFramework_Log::ORDER_DESC, 30);
$this->smarty->assign('client_log_entries', $client_log_entries);
$this->smarty->assign('worker_log_entries', $worker_log_entries);

View File

@@ -4,7 +4,7 @@ $main = RippingCluster_Main::instance();
$req = $main->request();
$config = $main->config();
if ($req->get('submit')) {
if ($req->exists('submit')) {
$action = RippingCluster_Main::issetelse($_POST['action'], 'RippingCluster_Exception_InvalidParameters');
# If a bulk action was selected, the action will be a single term, otherwise it will also contain

View File

@@ -1,7 +1,9 @@
<?php
$client_log_entries = RippingCluster_ClientLogEntry::recent(30);
$worker_log_entries = RippingCluster_WorkerLogEntry::recent(30);
$log = RippingCluster_Main::instance()->log();
$client_log_entries = RippingCluster_LogEntry::recentEntries($log, 'webui', 30);
$worker_log_entries = RippingCluster_LogEntry::recentEntries($log, 'worker', 30);
$this->smarty->assign('client_log_entries', $client_log_entries);
$this->smarty->assign('worker_log_entries', $worker_log_entries);