/** * add accesslog * @param $others other parameter * @param $tagPrefix tag prefix * @param $tagPostfix tag postfix */ public function add($others = null, $tagPrefix = '', $tagPostfix = '') { $request = $this->getRequest(); foreach ($this->options['remove'] as $key) { if (isset($request[$key])) { unset($request[$key]); } } foreach ($this->options['mask'] as $key) { if (isset($request[$key])) { $request[$key] = $this->options['mask_value']; } } $server = array(); foreach ($this->options['server'] as $key => $value) { if (isset($_SERVER[$key])) { $server[$value] = $_SERVER[$key]; } } $params = array_merge(array($this->options['request_key'] => $request), $server, is_null($others) ? array() : $others); $this->logger->post($tagPrefix . $this->options['tag'] . $tagPostfix, $params); }