Skip to content

Commit

Permalink
Improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimír Kriška committed Jan 22, 2017
1 parent 74b2eb5 commit 182b8ba
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,37 @@ composer require rekurzia/yii2-papertrail-log-target

## Usage

Add Sentry target to your configuration
Add new target to your configuration:

```php
$config['components']['log']['targets'] = [
[
'class' => Rekurzia\Log\PapertrailTarget::class,
'levels' => ['error', 'warning'],
'host' => 'logs[xxx].papertrailapp.com',
'port' => 1234,
'port' => '1234',
'additionalPrefix' => function() {
return Yii::$app->id;
},
],
];
```

### Configuration options

#### `host` and `port`

Host and port of your Papertrail log destination.

#### `additionalPrefix`

**Optional.** A PHP callable which allows you to add additional prefix. Useful when `[ip][userI][sessionId]` is not
enough. Setting as in example above, additional prefix `[yourApplicationId]` will be added.

#### `includeContextMessage`

**Optional.** Whether to include also context message. Defaults to `false`.

## License

MIT. See [license.txt](license.txt) file.

0 comments on commit 182b8ba

Please sign in to comment.