Skip to content

Commit

Permalink
Readme: Loggers improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
josefbenjac committed Aug 17, 2017
1 parent 0951a82 commit 19fae14
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
22 changes: 16 additions & 6 deletions .docs/README.md
Expand Up @@ -29,24 +29,34 @@ Basically, it overrides tracy default logger by universal, pluggable instance of
### Loggers
#### Default loggers

In Nette are this loggers by default:
Default loggers in Nette.

- **ExceptionFileLogger** - creates exception.log file
- **BlueScreenFileLogger** - creates exception-*.html

Wanna use custom logger and keep defaults?

```yaml
logging:
loggers:
- Contributte\Logging\ExceptionFileLogger(%logDir%)
- Contributte\Logging\BlueScreenFileLogger(%logDir%)
```

#### Email logger

If you need send logs via mail, use Email logger.

```yaml
services:
- Contributte\Logging\Mailer\TracyMailer(
from@email, #string|NULL
[to@email, to@email] #string[]
from@email,
[to@email, to2@email]
)

loggers:
- Contributte\Logging\SendMailLogger(%logDir%)
logging:
loggers:
- Contributte\Logging\SendMailLogger(..., %logDir%)
```

#### Custom logger
Expand All @@ -55,7 +65,7 @@ You can add custom loggers.

Use interface **Contributte\Logging\ILogger**.

Register logger and don't forget provide logDir.
Register logger

```yaml
logging:
Expand Down
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -32,6 +32,7 @@ composer require contributte/logging

- [Universal - how to use](https://github.com/contributte/logging/blob/master/.docs/README.md#tracyloggingextension)
- [Slack - how to use](https://github.com/contributte/logging/blob/master/.docs/README.md#slackloggingextension)
- [Sentry - how to use](https://github.com/contributte/logging/blob/master/.docs/README.md#sentryloggingextension)

## Maintainers

Expand All @@ -45,6 +46,13 @@ composer require contributte/logging
</br>
<a href="https://github.com/f3l1x">Milan Felix Šulc</a>
</td>
<td align="center">
<a href="https://github.com/benijo">
<img width="150" height="150" src="https://avatars3.githubusercontent.com/u/6731626?v=3&s=150">
</a>
</br>
<a href="https://github.com/benijo">Josef Benjač</a>
</td>
</tr>
<tbody>
</table>
Expand Down

0 comments on commit 19fae14

Please sign in to comment.