SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 495 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"


The first of these is the name of the log file not including the path. If we do not
provide any more parameters the log file will be located in the same directory as the
global error file.
The second parameter is an associative array of options. JLog currently only supports
one option, format. The format option is used to determine the format in which the
log entries are stored. By default this is:
{DATE}\t{TIME}\t{LEVEL}\t{C-IP}\t{STATUS}\t{COMMENT}
When we define a custom format string we use curly braces to encapsulate entry
field names. These fields relate directly to the keys that we described earlier when
adding an entry to a log file.
The third and final parameter is the path to the log file. This defaults to the global log
file path defined in the config (config.log_path).
This example gets an instance of a JLog that will handle the mylog.php log file
located in the root of the frontend of the current component. Each entry log entry
will have three fields, DATE, TIME, and DESCRIPTION in that order:
$options = array('format' => '{DATE}\t{TIME}\t{DESCRIPTION}');
$log =& JLog::getInstance('mylog.


Pages:
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507