<commit_before># Phapi Log
Package contains a Di Container Validator for validating loggers.

## Logger configuration
**Loggers must be PSR-3 compatible.** If no logger is configured or if the configured logger doesn't comply with PSR-3 then the <code>NullLogger</code> that is supplied in the PSR-3 package will be used.

In this example we will configure and use [Monolog](https://github.com/Seldaek/monolog) and set up a simple logger that logs to a file.

First, add the needed dependency to composer.json:
```shell
$ composer require monolog/monolog:1.*
```

After that it's just a matter of updating the configuration:

```php
<?php
use Monolog\Logger;
use Monolog\Handler\StreamHandler;

$phapi = new \Phapi\Phapi();

$phapi['log'] = function ($container) {
    $log = new Logger('default');
    $log->pushHandler(new StreamHandler('../logs/logfile.log', Logger::WARNING));
    return $log;
};
```

Usage:
```php
<?php
// add records to the log
$phapi['log']->warning('Foo');
$phapi['log']->error('Bar');
```<commit_msg>Updated documentation<commit_after># Phapi Log
Package contains a Di Container Validator for validating loggers.

## Logger configuration
**Loggers must be PSR-3 compatible.** If no logger is configured or if the configured logger doesn't comply with PSR-3 then the <code>NullLogger</code> that is supplied in the PSR-3 package will be used.

In this example we will configure and use [Monolog](https://github.com/Seldaek/monolog) and set up a simple logger that logs to a file.

First, add the needed dependency to composer.json:
```shell
$ composer require monolog/monolog:1.*
```

After that it's just a matter of updating the configuration:

```php
<?php
use Monolog\Logger;
use Monolog\Handler\StreamHandler;

$container['log'] = function ($container) {
    $log = new Logger('default');

    // IMPORTANT! Make sure you use an absolute path. Relative paths aren't guaranteed to
    // work in cases where errors and exceptions occur.
    $log->pushHandler(new StreamHandler(__DIR__ . '/../logs/logfile.log', Logger::WARNING));
    return $log;
};
```

Usage:
```php
<?php
// add records to the log
$container['log']->warning('Foo');
$container['log']->error('Bar');
```
{'fraction_non_alphanumeric': 0.13124432334241598, 'fraction_numerical': 0.0036330608537693005, 'mean_word_length': 4.6055979643765905, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '6999809', 'n_tokens_mistral': 659, 'n_tokens_neox': 635, 'n_words': 254}