Skip to content

Commit

Permalink
Docs: new version
Browse files Browse the repository at this point in the history
  • Loading branch information
josefbenjac authored and Milan Felix Šulc committed Jan 11, 2019
1 parent 82286d9 commit 2d42676
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
40 changes: 37 additions & 3 deletions .docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ logging:

Basically, it overrides Tracy's default logger by our universal, pluggable logger.

Original logger is still in DIC with `logging.originalLogger` key.

### Default loggers

There are 3 types of loggers defined by default.

- **FileLogger** - creates <priority>.log file
- **BlueScreenFileLogger** - creates exception-*.html
- **SendMailLogger** - sends exception to email
- **BlueScreenFileLogger** - creates exception-*.html from all throwable
- **SendMailLogger** - sends throwable/message to email

You can redefine these loggers in `logging.loggers`.

Expand All @@ -48,7 +50,23 @@ logging:
)
- App\Model\MyCustomerLogger
```


This configuration is functionally equal to original Tracy's logger, only separated to multiple classes.

#### SendMailLogger

Our SendMailLogger also allows configure priority levels.

```yaml
services:
sendMaillogger:
setup:
- setAllowedPriority(
Contributte\Logging\ILogger::WARNING,
Contributte\Logging\ILogger::ERROR
)
```

### Custom logger

To create your custom logger you have to implement `Contributte\Logging\ILogger`.
Expand Down Expand Up @@ -170,3 +188,19 @@ There you obtained DNS url. Put the url into neon file.
sentry:
url: https://<key>@sentry.io/<project>
```

`SentryLoggingExtension` adds `SentryLogger` with url configuration. It works as [SendMailLogger](#sendmaillogger).

It means that it sends messages/throwable with `ILogger::ERROR`, `ILogger::EXCEPTION`, `ILogger::CRITICAL` priorities.

But if you need other priorities, you can change configuration.

```yaml
services:
sentry.logger:
setup:
- setAllowedPriority(
Contributte\Logging\ILogger::WARNING,
Contributte\Logging\ILogger::ERROR
)
```
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ composer require contributte/logging

| State | Version | Branch | PHP |
|-------------|--------------|----------|----------|
| development | `dev-master` | `master` | `>= 5.6` |
| stable | `^0.2` | `master` | `>= 5.6` |
| development | `dev-master` | `master` | `>= 7.1` |
| stable | `^0.3` | `master` | `>= 7.1` |

## Overview

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "0.3.x-dev"
"dev-master": "0.4.x-dev"
}
}
}

0 comments on commit 2d42676

Please sign in to comment.