apps/admin_audit/lib/actions/action.php
/**
	 * Log a single action with a log level of info
	 *
	 * @param string $text
	 * @param array $params
	 * @param array $elements
	 * @param bool $obfuscateParameters
	 */
Log a single action with a log level of info
@param string $text
@param array $params
@param array $elements
@param bool $obfuscateParameters
Log a single action with a log level of info @param string $text @param array $params @param array $elements @param bool $obfuscateParameters
public function log($text,
						array $params,
						array $elements,
						$obfuscateParameters = false) {
		foreach($elements as $element) {
			if(!isset($params[$element])) {
				if ($obfuscateParameters) {
					$this->logger->critical(
						'$params["'.$element.'"] was missing.',
						['app' => 'admin_audit']
					);
				} else {
					$this->logger->critical(
						sprintf(
							'$params["'.$element.'"] was missing. Transferred value: %s',
							print_r($params, true)
						),
						['app' => 'admin_audit']
					);
				}
				return;
			}
		}
		$replaceArray = [];
		foreach($elements as $element) {
			if($params[$element] instanceof \DateTime) {
				$params[$element] = $params[$element]->format('Y-m-d H:i:s');
			}
			$replaceArray[] = $params[$element];
		}
		$this->logger->info(
			vsprintf(
				$text,
				$replaceArray
			),
			[
				'app' => 'admin_audit'
			]
		);
	}
public function log ( $ text , array $ params , array $ elements , $ obfuscateParameters = false ) { foreach ( $ elements as $ element ) { if ( ! isset ( $ params [ $ element ] ) ) { if ( $ obfuscateParameters ) { $ this -> logger -> critical ( '$params["' . $ element . '"] was missing.' , [ 'app' => 'admin_audit' ] ) ; } else { $ this -> logger -> critical ( sprintf ( '$params["' . $ element . '"] was missing. Transferred value: %s' , print_r ( $ params , true ) ) , [ 'app' => 'admin_audit' ] ) ; } return ; } } $ replaceArray = [ ] ; foreach ( $ elements as $ element ) { if ( $ params [ $ element ] instanceof \ DateTime ) { $ params [ $ element ] = $ params [ $ element ] -> format ( 'Y-m-d H:i:s' ) ; } $ replaceArray [ ] = $ params [ $ element ] ; } $ this -> logger -> info ( vsprintf ( $ text , $ replaceArray ) , [ 'app' => 'admin_audit' ] ) ; }
Log a single action with a log level of info
 @param string $text
 @param array $params
 @param array $elements
 @param bool $obfuscateParameters
Log a single action with a log level of info @param string $text @param array $params @param array $elements @param bool $obfuscateParameters