phpDocumentor log
[ class tree: log ] [ index: log ] [ all elements ]

Class: Log

Source Location: /myphp-1.9/myphp-1.9-log/html/util/Log.php

Class Log

Class Overview

Log facility utilizing the function error_log()

  1. Usage:
  2. Log::insert(__FILE__,__LINE__,$myInsertMessage); // SQL
  3. Log::update(__FILE__,__LINE__,$myUpdateMessage);
  4. Log::delete(__FILE__,__LINE__,$myDeleteMessage);
  5. Log::query (__FILE__,__LINE__,$myQueryMessage);
  6.  
  7. Log::debug (__FILE__,__LINE__,$myDebugMessage);
  8. Log::info (__FILE__,__LINE__,$myInfoMessage);
  9. Log::warn (__FILE__,__LINE__,$myWarnMessage);
  10. Log::error (__FILE__,__LINE__,$myErrorMessage);
  11. Log::fatal (__FILE__,__LINE__,$myFatalMessage);
  12.  
  13. Log::email (__FILE__,__LINE__,$myEmailMessage); // Email
  14. Log::sms (__FILE__,__LINE__,$mySmsMessage); // SMS
  15.  
  16. Log::referer($info); // Log referer info, where did the user came from
  17. Log::domain ($info); // Log domain info, where did user come from
  18. Log::phrase ($info); // Log phase info, what did user seached for
  19.  
  20. Log::user(); // Log user data
  21.  
  22. Log::getRequestInfo();

Located in /myphp-1.9/myphp-1.9-log/html/util/Log.php [line 49]



		
		
		
		

Methods

[ Top ]
Method Summary
Log   Log()   Constructor
void   add()   Add an entry to the log file
void   debug()  
void   delete()  
void   domain()  
void   email()  
void   error()  
void   fatal()  
String   getLevelName()   Get the level name
String   getRequestInfo()   Get the request information
void   info()  
void   insert()  
boolean   isEnabled()   Check to se, if the requested log level is active or not
String   mkdir()   Create a new log directory $path.'/'.$name or
void   phrase()  
void   query()  
void   referer()   Helper function
void   sms()  
void   update()  
void   user()   Add an entry to the log file with the request params
void   warn()  

[ Top ]
Methods
Constructor Log  [line 54]

  Log Log( )

Constructor



[ Top ]
add  [line 74]

  void add( String $file, String $line, [String $text = ''], [String $level = '']  )

Add an entry to the log file

  1. Usage:
  2. Log::add($file,$line,$text,$level);
  3. The funtion will log the data with a filename as
  4. no-level-hostname.log where
  5. no, is a number from 0-365 (day of the year)
  6. level, is the log level defined i.e. ERROR
  7. hostname, is the domain host name

Parameters:
String   $file:  The file name, use: __FILE__
String   $line:  The line number, use: __LINE__
String   $text:  The text to log
String   $level:  The log level to log

API Tags:
Static:  


[ Top ]
debug  [line 254]

  void debug( mixed $file, mixed $line, [mixed $text = '']  )



[ Top ]
delete  [line 250]

  void delete( mixed $file, mixed $line, [mixed $text = '']  )



[ Top ]
domain  [line 230]

  void domain( [mixed $text = '']  )



[ Top ]
email  [line 274]

  void email( mixed $file, mixed $line, [mixed $text = '']  )



[ Top ]
error  [line 266]

  void error( mixed $file, mixed $line, [mixed $text = '']  )



[ Top ]
fatal  [line 270]

  void fatal( mixed $file, mixed $line, [mixed $text = '']  )



[ Top ]
getLevelName  [line 150]

  String getLevelName( mixed $level, String $level,  )

Get the level name

Get the name of the current loglevel

  1. Usage:
  2. Log::getLevelName($level);

Parameters:
String   $level,:  The log level to use

API Tags:
Return:  The name of the log level
Static:  


[ Top ]
getRequestInfo  [line 291]

  String getRequestInfo( )

Get the request information

  1. Usage:
  2. $requestInfo = Log::getRequestInfo();


API Tags:
Return:  The request as a string
Static:  


[ Top ]
info  [line 258]

  void info( mixed $file, mixed $line, [mixed $text = '']  )



[ Top ]
insert  [line 242]

  void insert( mixed $file, mixed $line, [mixed $text = '']  )



[ Top ]
isEnabled  [line 348]

  boolean isEnabled( [int $level = LOG_LEVEL_DEBUG]  )

Check to se, if the requested log level is active or not

  1. Usage:
  2. $isEnabled = Log::isEnabled($level);

Parameters:
int   $level:  The level to check. I.e. LOG_LEVEL_DEBUG

API Tags:
Return:  True if active, else false
Static:  


[ Top ]
mkdir  [line 128]

  String mkdir( String $path, String $name  )

Create a new log directory $path.'/'.$name or

return the name of log directory if already exists

  1. Usage:
  2. Log::mkdir($path,$name);

Parameters:
String   $path:  The path of the existing log directory
String   $name:  The name of the new directory to use

API Tags:
Return:  The name of the new log directory or the old one
Static:  


[ Top ]
phrase  [line 234]

  void phrase( [mixed $text = '']  )



[ Top ]
query  [line 238]

  void query( mixed $file, mixed $line, [mixed $text = '']  )



[ Top ]
referer  [line 226]

  void referer( [String $text = ''], String $file, String $line, String $level  )

Helper function

  1. Usage:
  2. Log::xxx(__FILE__,__LINE__,$message);
  3. Where xxx is one of:
  4. query, user, debug, info, warn, error, fatal or email

Parameters:
String   $file:  The file, use __FILE__
String   $line:  The line, use __LINE__
String   $text:  The text to log
String   $level:  The log level to use

API Tags:
Static:  


[ Top ]
sms  [line 278]

  void sms( mixed $file, mixed $line, [mixed $text = '']  )



[ Top ]
update  [line 246]

  void update( mixed $file, mixed $line, [mixed $text = '']  )



[ Top ]
user  [line 334]

  void user( [String $text = '']  )

Add an entry to the log file with the request params

  1. Usage:
  2. Log::user($text);

Parameters:
String   $text:  The text to log

API Tags:
Static:  


[ Top ]
warn  [line 262]

  void warn( mixed $file, mixed $line, [mixed $text = '']  )



[ Top ]

Documentation generated on Thu, 22 Dec 2005 17:13:03 +0100 by phpDocumentor 1.3.0RC3