Skip to content

Commit

Permalink
Update to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lyal committed Dec 22, 2017
1 parent 638353c commit 3c2ae7c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ $ composer require lyal/monolog-logdna

``` php
$logger = new Logger('general');
$logdnaHandler = new LogDNAHandler();
$logdnaHandler = new LogDNAHandler('YOUR_API_KEY'); // Can also be passed by env
$logger->pushHandler($logdnaHandler);
$logger->debug('this is my message!');
```

Expand Down
7 changes: 5 additions & 2 deletions src/LogDNAHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ public function __construct(
$httpClient = null,
$level = Logger::DEBUG,
$bubble = true
) {

)
{


parent::__construct($level, $bubble);
$this->key = $key ?? getenv('LOGDNA_INGESTION_KEY');
Expand Down Expand Up @@ -87,6 +88,8 @@ protected function write(array $record)
'auth' => [$this->key, ''],
'body' => $record['formatted']
]);


}

/**
Expand Down

0 comments on commit 3c2ae7c

Please sign in to comment.