Skip to content

Commit

Permalink
ShipSaaS Logger
Browse files Browse the repository at this point in the history
  • Loading branch information
sethsandaru committed Oct 25, 2023
1 parent de78b8e commit 7ee71c6
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ We ship a new Logger driver called `shipsaas-logger` which handles:

Thus, it fixes the missing logs issue because we have **independent log files** and not yolo-write into 1 file (which will mess up the logs when having high traffic) 🚀

And the last step, tell Sumologic (or Cloudwatch, etc.) to sync your logs folder 🔥. All your logs will be on the cloud.
Nowadays, we can just tell Sumologic (or Cloudwatch, DataDog, etc.) to sync your log folder (a whole folder) 🔥.
All your logs will be synced on the cloud.

### Set up `config/logging.php`

Expand All @@ -63,7 +64,29 @@ LOG_CHANNEL=shipsaas-logger
### Play
Now that you have everything, hit some requests and try it out 😎.

And congrats, no more "missing logs" pain for your app 😉.
```php
class TransferController extends BaseController
{
public function transfer(): JsonResponse
{
Log::info('begin transfer', [
'amount' => ...,
'recipient' => ...,
]); // this log will have uniqueRequestId

// ...


Log::info('transferred', [
'amount' => ...,
'recipient' => ...,
'trasaction_id' => ...,
]); // this log will have uniqueRequestId
}
}
```

And also congrats, no more "missing logs" pain for your app 😉.

## Usage (Minimalism)

Expand Down

0 comments on commit 7ee71c6

Please sign in to comment.