Skip to content

Commit abbe6ac

Browse files
authored
Merge pull request #89 from dotkernel/issue-84
Issue #84: Remove PHP 8.1 and add PHP 8.4 & 8.5 support
2 parents 4eb93f5 + 42e9ddb commit abbe6ac

29 files changed

Lines changed: 115 additions & 125 deletions

‎.github/workflows/codecov.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
- ubuntu-latest
1616

1717
php:
18-
- "8.1"
1918
- "8.2"
2019
- "8.3"
2120
- "8.4"
21+
- "8.5"
2222

2323
steps:
2424
- name: Checkout

‎.github/workflows/static-analysis.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
- ubuntu-latest
1616

1717
php:
18-
- "8.1"
1918
- "8.2"
2019
- "8.3"
2120
- "8.4"
21+
- "8.5"
2222

2323
steps:
2424
- name: Checkout

‎README.md‎

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,23 @@
22

33
Robust, composite PSR-3 compliant logger with filtering and formatting.
44

5+
## Version History
6+
7+
| Branch | Service Manager | Log style implementation | PHP Version |
8+
|--------|-------------------|--------------------------|---------------------------------------------------------------------------------------------------------|
9+
| 5.0 | Service Manager 4 | PSR-Log | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-log/5.3.0) |
10+
| 4.1 | Service Manager 4 | Laminas Log style | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-log/4.1.3) |
11+
| 4.0 | Service Manager 3 | Laminas Log style | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-log/4.0.5) |
12+
| 3.0 | Service Manager 3 | Laminas Log | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-log/3.5.4) |
13+
514
## Documentation
615

716
Documentation is available at: https://docs.dotkernel.org/dot-log/.
817

918
## Badges
1019

1120
![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/dot-log)
12-
![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-log/5.1.0)
21+
![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-log/5.3.0)
1322

1423
[![GitHub issues](https://img.shields.io/github/issues/dotkernel/dot-log)](https://github.com/dotkernel/dot-log/issues)
1524
[![GitHub forks](https://img.shields.io/github/forks/dotkernel/dot-log)](https://github.com/dotkernel/dot-log/network)
@@ -39,8 +48,8 @@ A writer is an object that inherits from `Dot\Log\Writer\AbstractWriter`. A writ
3948

4049
### Writing to a file (stream)
4150

42-
It is possible separate logs into multiple files using writers and filters.
43-
For example *warnings.log*, *errors.log*, *all_messages.log*.
51+
It is possible to separate logs into multiple files using writers and filters.
52+
For example, *warnings.log*, *errors.log*, *all_messages.log*.
4453

4554
The following is the simplest example to write all log messages to `/log/dk.log`
4655

@@ -67,16 +76,16 @@ return [
6776
* The `FileWriter` key is optional, otherwise the writers array would be enumerative instead of associative.
6877
* The writer name key is a developer-provided name for that writer, the writer name key is **mandatory**.
6978

70-
The writer level key is not affecting the errors that are written, it is a way to organize writers.
79+
The writer level key is not affecting the errors that are written; it is a way to organize writers.
7180

7281
The writer level key is optional.
7382

74-
To write into a file the key stream must be present in the writer options array. This is required only if writing into streams/files.
83+
To write into a file, the key stream must be present in the writer options array. This is required only if writing into streams/files.
7584

7685
## Grouping log files by date
7786

7887
By default, logs will be written to the same file: `log/dk.log`.
79-
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.
88+
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.
8089
Examples:
8190

8291
* `log/dk-{Y}-{m}-{d}.log` will write every day to a different file (eg: `log/dk-2021-01-01.log`)
@@ -147,7 +156,7 @@ return [
147156
'importantMessages' => [
148157
'name' => 'level',
149158
'options' => [
150-
// note, the smaller the level, the more important is the message
159+
// note, the smaller the level, the more important the message
151160
// 0 - emergency, 1 - alert, 2- error, 3 - warn. .etc
152161
'operator' => '<=',
153162
'level' => \Dot\Log\Logger::WARN,
@@ -165,7 +174,7 @@ return [
165174

166175
As in the writer configuration, the developer can optionally use keys for associating the filters with a name.
167176

168-
IMPORTANT NOTE: the operator for more important messages is <=, this is because the number representation is smaller for a more important message type.
177+
IMPORTANT NOTE: the operator for more important messages is `<=`, this is because the number representation is smaller for a more important message type.
169178

170179
The filter added on the first writer is equal to not setting a filter, but it has been added to illustrate how to explicitly allow all messages.
171180

@@ -175,14 +184,14 @@ It was added opposite to the others just to demonstrate the other operator is al
175184

176185
When using `dot-log`, the logged value is not limited to a string. Arrays can be logged as well.
177186

178-
For a better readability, these arrays can be serialized.
187+
For better readability, these arrays can be serialized.
179188

180189
Dot Log provides String formatting and JSON formatting.
181190

182-
The formatter accepts following parameters:
191+
The formatter accepts the following parameters:
183192

184-
name - the formatter class (it must implement `Dot\Log\Formatter\FormatterInterface`)
185-
options - options to pass to the formatter constructor if required
193+
* `name`: the formatter class (it must implement `Dot\Log\Formatter\FormatterInterface`)
194+
* `options`: options to pass to the formatter constructor if required
186195

187196
The following formats the message as JSON data:
188197

@@ -243,15 +252,9 @@ Basic usage of the logger is illustrated below.
243252
The messages are written to see which logs are written and which are not written.
244253

245254
```php
246-
use Dot\Log\Logger;
247-
```
248-
249-
...
250-
251-
```php
255+
/** @var \Dot\Log\Logger $logger */
252256
$logger = $container->get('dot-log.my_logger');
253257

254-
/** @var Logger $logger */
255258
$logger->emergency('0 EMERG');
256259
$logger->alert('1 ALERT');
257260
$logger->critical('2 CRITICAL');

‎SECURITY.md‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55

66
| Version | Supported | PHP Version |
77
|---------|--------------------|---------------------------------------------------------------------------------------------------------|
8-
| 5.x | :white_check_mark: | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-log/5.0.0) |
9-
| 4.x | :white_check_mark: | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-log/4.1.0) |
10-
| 3.x | :white_check_mark: | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-log/3.4.7) |
11-
| <= 2.x | :x: | |
8+
| 5.x | :white_check_mark: | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-log/5.3.0) |
9+
| 4.x | :white_check_mark: | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-log/4.1.3) |
10+
| <= 3.x | :x: | |
1211

1312

1413
## Reporting Potential Security Issues

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818
],
1919
"require": {
20-
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
20+
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
2121
"laminas/laminas-servicemanager": "^4.0",
2222
"laminas/laminas-validator": "^3.0",
2323
"psr/log": "^3.0.2"

‎docs/book/v3/adding-config-provider.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* `\Frontend\App\ConfigProvider.php`
66
* `\Admin\App\ConfigProvider::class`
77
* `\MyProject\ConfigProvider::class` etc.
8-
* 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.
8+
* 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.
99

10-
> `Dot\Log\ConfigProvider` has an abstract factory `LoggerAbstractServiceFactory::class` which corresponds to the alias, not the class name.
10+
> `Dot\Log\ConfigProvider` has an abstract factory `LoggerAbstractServiceFactory::class` which corresponds to the alias, not the class name.
1111
> Instead of requesting `Laminas\Log\Logger::class` from the container, use `dot-log.my_logger` (or just `my_logger` if using laminas-log).

‎docs/book/v3/configuring-writer.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A writer's responsibility is to record log data to a storage backend. (from lami
88
## Writing to a file (stream)
99

1010
You can separate logs into multiple files using writers and filters.
11-
For example *warnings.log*, *errors.log*, *all_messages.log*.
11+
For example, *warnings.log*, *errors.log*, *all_messages.log*.
1212

1313
The following is the simplest example to write all log messages to `/log/dk.log`:
1414

@@ -38,11 +38,11 @@ return [
3838
The `priority` key does not affect the errors that are written.
3939
It is a way to organize writers, for example:
4040

41-
* 1 - FILE
42-
* 2 - SQL
43-
* 3 - E-mail
41+
* 1: FILE
42+
* 2: SQL
43+
* 3: E-mail
4444

45-
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.
45+
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.
4646

4747
The `priority` key is optional.
4848

‎docs/book/v3/filtering-log-messages.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ return [
7272
'importantMessages' => [
7373
'name' => 'priority',
7474
'options' => [
75-
// note, the smaller the priority, the more important is the message
76-
// 0 - emergency, 1 - alert, 2- error, 3 - warn etc.
75+
// note, the smaller the priority, the more important the message
76+
// 0 - emergency, 1 - alert, 2- error, 3 - warn, etc.
7777
'operator' => '<=',
7878
'priority' => \Laminas\Log\Logger::WARN,
7979
],

‎docs/book/v3/formatting-messages.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
When using `dot-log` or `laminas-log`, the logged value is not limited to a string.
44
Arrays can be logged as well.
55
For better readability, these arrays can be serialized.
6-
Laminas Log provides String, XML, JSON and FirePHP formatting.
6+
LaminasLog provides String, XML, JSON and FirePHP formatting.
77

8-
The formatter accepts following parameters:
8+
The formatter accepts the following parameters:
99

10-
* name - the formatter class (it must implement `Laminas\Log\Formatter\FormatterInterface`)
11-
* options - passed to the formatter constructor if required
10+
- `name`: the formatter class (it must implement `Laminas\Log\Formatter\FormatterInterface`)
11+
- `options`: passed to the formatter constructor if required
1212

1313
The following snippet formats the message as JSON data:
1414

‎docs/book/v3/grouping-log-files-by-date.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
By default, logs will be written to the same file: `log/dk.log`.
44

5-
Optionally, you can use date format specifiers wrapped between curly braces in your FileWriter's `stream` option to automatically group your logs by day, week, month, year etc.
5+
Optionally, you can use date format specifiers wrapped between curly braces in your FileWriter's `stream` option to automatically group your logs by day, week, month, year, etc.
66

77
Examples:
88

0 commit comments

Comments
 (0)