Skip to content

Commit

Permalink
Docs improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
josefbenjac committed Aug 17, 2017
1 parent c74dffb commit 64b2415
Showing 1 changed file with 41 additions and 5 deletions.
46 changes: 41 additions & 5 deletions .docs/README.md
Expand Up @@ -8,24 +8,60 @@

## TracyLoggingExtension

**:warning: Logging works only when debug-mode is disabled**

First of all, we need to register our universal tuned logger for future purpose.

```yaml
extensions:
logging: Contributte\Logging\DI\TracyLoggingExtension
```

A few configuration options:
After that, we need provide logDir path.

```yaml
logging:
logDir: %appDir%/../log
mailer:
from: my@app.com
to: [my@email.com]
```

Basically, it overrides tracy default logger & mailer by universal, pluggable instance of logger.
Basically, it overrides tracy default logger by universal, pluggable instance of logger.

### Loggers
#### Default loggers

In Nette are this loggers by default:

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

#### 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[]
)

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

#### Custom logger

You can add custom loggers.

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

Register logger and don't forget provide logDir.

```yaml
logging:
loggers:
- SampleLogger(%logDir%)
```

## SlackLoggingExtension

Expand Down

0 comments on commit 64b2415

Please sign in to comment.