Skip to content

Commit 3199c42

Browse files
author
Sebastian Schöps
committed
Keys can have any length
1 parent 476589c commit 3199c42

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ php artisan loggy:key
1616
```
1717
The output of the command shows you your future Loggy link. Open this link now in a browser before you test your Loggy installation.
1818

19+
You can set the key `LOGGY_KEY` in `.env` to anything you want. Just remember that all apps with the same key share the same URL.
20+
1921
### Test Loggy
2022
You can send a test entry to Loggy:
2123
```
@@ -28,7 +30,7 @@ Just put the following in your Laravel code to send information to Loggy:
2830
```
2931
loggy($myMessage);
3032
```
31-
`myMessage` can be anything that can be translated into JSON (usually you would use a string or an array).
33+
`myMessage` can be basically anything.
3234

3335
### Time measurement
3436
You can start and stop a time measurement with

config/loggy.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
'enabled' => env('LOGGY_ENABLED', true),
55
'url' => env('LOGGY_URL', 'https://loggy.live'),
66
'key' => env('LOGGY_KEY'),
7-
'key-length' => 60
7+
'default-key-length' => 60
88
];

src/Commands/KeyGenerateCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class KeyGenerateCommand extends Command
2828
*/
2929
public function handle()
3030
{
31-
$key = Str::random(config('loggy.key-length'));
31+
$key = Str::random(config('loggy.default-key-length'));
3232

3333
// Next, we will replace the loggy key in the environment file so it is
3434
// automatically setup for this developer.

src/Loggy.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class Loggy
1717

1818
public function __construct($url, $key)
1919
{
20-
if(strlen($key) != config('loggy.key-length')) {
21-
throw new LoggyException('Key must have a length of ' . config('loggy.key-length') . ' characters');
20+
if(strlen($key) <1) {
21+
throw new LoggyException('Key must have a length of at least 1 characters');
2222
}
2323
$this->url = $url;
2424
$this->key = $key;

0 commit comments

Comments
 (0)