<commit_before><?php

namespace RcmErrorHandler2\Log;

/**
 * Class FileErrorLogger
 *
 * PHP version 5
 *
 * @category  Reliv
 * @package   RcmErrorHandler2\Log
 * @author    <NAME> <<EMAIL>>
 * @copyright 2015 Reliv International
 * @license   License.txt
 * @version   Release: <package_version>
 * @link      https://github.com/reliv
 */
class FileErrorLogger extends AbstractErrorLogger
{
    /**
     * Add a message as a log entry
     *
     * @param  int                $priority
     * @param  mixed              $message
     * @param  array|\Traversable $extra
     *
     * @return void
     */
    public function log($priority, $message, array $extra = [])
    {
        if (extension_loaded('xdebug')) {
            ini_set('xdebug.var_display_max_depth', 4);
        }
        $now = new \DateTime('now', new \DateTimeZone('UTC'));
        $array = [];

        $array['summary:'] = $this->prepareSummary($priority, $message);
        $array['priority:'] = $priority;

        $array['time:'] = $now->format('Y-m-d-H:m:s');
        $array['message:'] = $message;
        if (isset($extra['trace'])) {
            $array['trace:'] = $extra['trace'];
        }

        if (isset($extra['traceArray'])) {
            $array['traceArray:'] = $extra['traceArray'];
        }

        if (isset($extra['exception'])) {
            $array['exception:'] = $this->prepareException($extra['exception']);
        }

        if (isset($extra['handler'])) {
            $array['handler:'] = $extra['handler'];
        }

        $contents = json_encode($array, JSON_PRETTY_PRINT);

        $fileLogPath = $this->getOption(
            'fileLogPath',
            '/var/log'
        );

        $fileName = $this->getOption(
            'fileName',
            'rcm-error-handler-2-log'
        );<commit_msg>Update file logger<commit_after><?php

namespace RcmErrorHandler2\Log;

/**
 * Class FileErrorLogger
 *
 * PHP version 5
 *
 * @category  Reliv
 * @package   RcmErrorHandler2\Log
 * @author    <NAME> <<EMAIL>>
 * @copyright 2015 Reliv International
 * @license   License.txt
 * @version   Release: <package_version>
 * @link      https://github.com/reliv
 */
class FileErrorLogger extends AbstractErrorLogger
{
    /**
     * Add a message as a log entry
     *
     * @param  int                $priority
     * @param  mixed              $message
     * @param  array|\Traversable $extra
     *
     * @return void
     */
    public function log($priority, $message, array $extra = [])
    {
        if (extension_loaded('xdebug')) {
            ini_set('xdebug.var_display_max_depth', 4);
        }
        $now = new \DateTime('now', new \DateTimeZone('UTC'));
        $array = [];

        $array['summary:'] = $this->prepareSummary($priority, $message);
        $array['priority:'] = $priority;

        $array['time:'] = $now->format('Y-m-d-H:m:s');
        $array['message:'] = $message;
        if (isset($extra['trace'])) {
            $array['trace:'] = $extra['trace'];
        }

        if (isset($extra['traceArray'])) {
            $array['traceArray:'] = $extra['traceArray'];
        }

        if (isset($extra['exception'])) {
            $array['exception:'] = $this->prepareException($extra['exception']);
        }

        if (isset($extra['handler'])) {
            $array['handler:'] = $extra['handler'];
        }

        $contents = json_encode($array, $this->getOption('json-options', 0));

        $fileLogPath = $this->getOption(
            'fileLogPath',
            '/var/log'
        );

        $fileName = $this->getOption(
            'fileName',
            'rcm-error-handler-2-log'
        );
{'fraction_non_alphanumeric': 0.1708253358925144, 'fraction_numerical': 0.005209761447765287, 'mean_word_length': 2.150259067357513, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 22, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5601209', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1080, 'n_words': 203}