1. Go to this page and download the library: Download nextcloud/lognormalizer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nextcloud / lognormalizer example snippets
use Nextcloud\LogNormalizer\Normalizer;
$normalizer = new Normalizer();
/**
* Converts the variables in the received log message to string before
* sending everything to the real logger
*
* @param string $level
* @param string $message
* @param array $variables
*
* @return mixed
*/
public function log($level, $message, array $variables= []) {
array_walk($variables, [$this->normalizer, 'format']);
// Then use your current PSR-3 compatible logging system
$this->logger->log($level, $message, $variables);
}