Skip to content

Commit

Permalink
Merge pull request #46 from Jurj-Bogdan/issue45
Browse files Browse the repository at this point in the history
marked package as wrapper
  • Loading branch information
arhimede committed Jun 28, 2024
2 parents 9ac2997 + fffa770 commit 01b664d
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# dot-log

DotKernel log component extending and customizing
> [!IMPORTANT]
> dot-log is a wrapper on top of [laminas-log](https://github.com/laminas/laminas-log)
>
> ![OSS Lifecycle](https://img.shields.io/osslifecycle/laminas/laminas-log)
## dot-log badges

![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/dot-log)
![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-log/3.4.4)
Expand All @@ -20,11 +25,11 @@ DotKernel log component extending and customizing
* Enter config/config.php
* If there is no entry for the config provider below, add it:
`\Dot\Log\ConfigProvider::class`
* Make sure it is added before with the Application-Specific components, eg.: \Frontend\App\ConfigProvider.php, `\Admin\App\ConfigProvider::class`, `MyProject\ConfigProvider::class` , etc.
* Make sure it is added before with the Application-Specific components, eg.: `\Frontend\App\ConfigProvider.php`, `\Admin\App\ConfigProvider::class`, `MyProject\ConfigProvider::class` , etc.
* Open the `Dot\Log\ConfigProvider`
* In the dependencies section you will see an absctract factory (LoggerAbstractServiceFactory::class)
* In the dependencies section you will see an abstract factory (`LoggerAbstractServiceFactory::class`)
* This class responds to "selectors" instead of class names
Instead of requesting the `Laminas\Log\Logger::class`from the container, dot-log.my_logger should be requested (or just `my_logger` if using laminas-log)
Instead of requesting the `Laminas\Log\Logger::class` from the container, `dot-log.my_logger` should be requested (or just `my_logger` if using `laminas-log`)

## Configuring the writer(s)

Expand Down Expand Up @@ -79,8 +84,8 @@ By default, logs will be written to the same file: `log/dk.log`.
Optionally, you can use date format specifiers wrapped between curly braces in your FileWriter's `stream` option, automatically grouping your logs by day, week, month, year etc.
Examples:

* `log/dk-{Y}-{m}-{d}.log` will write every day to a different file (eg: log/dk-2021-01-01.log)
* `log/dk-{Y}-{W}.log` will write every week to a different file (eg: log/dk-2021-10.log)
* `log/dk-{Y}-{m}-{d}.log` will write every day to a different file (eg: `log/dk-2021-01-01.log`)
* `log/dk-{Y}-{W}.log` will write every week to a different file (eg: `log/dk-2021-10.log`)

The full list of format specifiers is available [here](https://www.php.net/manual/en/datetime.format.php).

Expand Down Expand Up @@ -185,14 +190,16 @@ Laminas Log provides String formatting, XML, JSON and FirePHP formatting.

The formatter accepts following parameters:

name - the formatter class (it must implement Laminas\Log\Formatter\FormatterInterface)
name - the formatter class (it must implement `Laminas\Log\Formatter\FormatterInterface`)
options - options to pass to the formatter constructor if required

The following formats the message as JSON data:

```php
'formatter' => [
'name' => \Laminas\Log\Formatter\Json::class,
],
```

### Example with formatter

Expand Down Expand Up @@ -240,7 +247,7 @@ return [

## Usage

Basic usage of the logger is illustraded below.
Basic usage of the logger is illustrated below.

The messages are written to see which logs are written and which are not written.

Expand Down

0 comments on commit 01b664d

Please sign in to comment.