00001 <?php
00021 load_module('socket');
00031 class zLogClient extends zSocketClient{
00032 function zLogClient(){
00033 $this->__construct();
00034 }
00035 function __construct(){
00036 parent::__construct(zDef::get('Z_LOG_SOCK_HOST'), zDef::get('Z_LOG_SOCK_PORT'), zDef::get('Z_LOG_SOCK_TIMEOUT'));
00037 if(!$this->connect()){
00038 perror('Failed to Connect with Log server');
00039 if(class_exists('zLogger'))zLogger::error('Failed to Conect with the Log server', 'log.socket');
00040 exit;
00041 }
00042 }
00043 function write($headerObj){
00044 $header = "TimeStamp: ".$headerObj['timestamp']."\r\n";
00045 $header .= "Time: ".$headerObj['time']."\r\n";
00046 $header .= "Type: ".$headerObj['type']."\r\n";
00047 $header .= "Title: ".$headerObj['title']."\r\n";
00048 $header .= "Msg: ".$headerObj['msg']."\r\n.\r\n";
00049
00050 $this->send($header);
00051 }
00052 }
00054 ?>