Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergiu committed Aug 28, 2024
1 parent cd68e12 commit d943bb4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/book/v4/adding-config-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* `\MyProject\ConfigProvider::class` etc.
* Add the logger configuration in an autoload config file, e.g. you can create `config/autoload/logger.global.php`. Follow the `Configuring the writer(s)` chapter for a simple working example.

Note: `Dot\Log\ConfigProvider` has an abstract factory `LoggerAbstractServiceFactory::class` which corresponds to the alias, not the class name. Instead of requesting `Laminas\Log\Logger::class` from the container, use `dot-log.my_logger` (or just `my_logger` if using laminas-log).
Note: `Dot\Log\ConfigProvider` has an abstract factory `LoggerAbstractServiceFactory::class` which corresponds to the alias, not the class name. Instead of requesting `Dot\Log\Logger::class` from the container, use `dot-log.my_logger`.
10 changes: 2 additions & 8 deletions docs/book/v4/configuring-writer.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Loggers must have at least one writer.

A writer is an object that inherits from `Laminas\Log\Writer\AbstractWriter`. A writer's responsibility is to record log data to a storage backend. (from laminas-log's writer documentation)
A writer is an object that inherits from `Dot\Log\Writer\AbstractWriter`. A writer's responsibility is to record log data to a storage backend.

## Writing to a file (stream)

Expand Down Expand Up @@ -33,13 +33,7 @@ return [
* The `FileWriter` key is optional, otherwise the writers array would be enumerative instead of associative.
* The `name` key is a developer-provided name for that writer, the writer name key is **mandatory**.

The `priority` key does not affect the errors that are written. It is a way to organize writers, for example:

* 1 - FILE
* 2 - SQL
* 3 - E-mail

The most important things to write in the file, the sql or e-mail are usually fails because the servers can be external and offline, but the file is on the same server.
The `priority` key does not affect the errors that are written. It is a way to organize writers.

The `priority` key is optional.

Expand Down
4 changes: 1 addition & 3 deletions docs/book/v4/filtering-log-messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The log levels are in order of priority/importance:
* info (6)
* debug (7)

Although the plain Logger in `laminas-log` is not fully compatible with PSR-3, it provides a way to log all of these message types.
Although the plain Logger in `dot-log` is not fully compatible with PSR-3, it provides a way to log all of these message types.

The following example has three file writers using filters:

Expand Down Expand Up @@ -93,5 +93,3 @@ As in the writer configuration, the developer can optionally use keys for associ
IMPORTANT NOTE: the operator for more important messages is `<=`, this is because the number representation is smaller for a more important message type.

The filter added on the first writer is equivalent to not setting a filter, but it was added to illustrate the usage of the operator to explicitly allow all messages.

More examples on filters: https://docs.laminas.dev/laminas-log/filters/
6 changes: 3 additions & 3 deletions docs/book/v4/formatting-messages.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Formatting Messages

When using `dot-log` or `laminas-log`, the logged value is not limited to a string. Arrays can be logged as well. For better readability, these arrays can be serialized. Laminas Log provides String, XML, JSON and FirePHP formatting.
When using `dot-log`, the logged value is not limited to a string. Arrays can be logged as well. For better readability, these arrays can be serialized. Dot Log provides String and JSON formatting.

The formatter accepts following parameters:

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

The following snippet formats the message as JSON data:

'formatter' => [
'name' => \Laminas\Log\Formatter\Json::class,
'name' => \Dot\Log\Formatter\Json::class,
],
4 changes: 1 addition & 3 deletions docs/book/v4/overview.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Overview

> 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)
Robust, composite logger with filtering, formatting, and PSR-3 support.

0 comments on commit d943bb4

Please sign in to comment.