1 <?php
2 /**
3 * @package Joomla.Platform
4 * @subpackage Log
5 *
6 * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
7 * @license GNU General Public License version 2 or later; see LICENSE
8 */
9
10 defined('JPATH_PLATFORM') or die;
11
12 /**
13 * Joomla! W3C Logging class
14 *
15 * This class is designed to build log files based on the W3C specification.
16 *
17 * @link https://www.w3.org/TR/WD-logfile.html
18 * @since 11.1
19 */
20 class JLogLoggerW3c extends JLogLoggerFormattedtext
21 {
22 /**
23 * The format which each entry follows in the log file.
24 *
25 * All fields must be named in all caps and be within curly brackets eg. {FOOBAR}.
26 *
27 * @var string
28 * @since 11.1
29 */
30 protected $format = '{DATE} {TIME} {PRIORITY} {CLIENTIP} {CATEGORY} {MESSAGE}';
31
32 /**
33 * Constructor.
34 *
35 * @param array &$options Log object options.
36 *
37 * @since 11.1
38 */
39 public function __construct(array &$options)
40 {
41 // The name of the text file defaults to 'error.w3c.php' if not explicitly given.
42 if (empty($options['text_file']))
43 {
44 $options['text_file'] = 'error.w3c.php';
45 }
46
47 // Call the parent constructor.
48 parent::__construct($options);
49 }
50 }
51