Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

booni3's avatar

Logging in Laravel Vapor (Papertrail, Flare, Sentry - nothing is working!)

I have a vapor project and I cannot get any form of logging to work. I have setup flare, sentry and papertrail but nothing registers.

I am using the vapor env:pull production (then push) commands to edit the config with my api keys. I have tested on non-vapor and it works fine there.

Other .env variables such as the database name are being accepted OK so I assume that its an issue to do with these packages running server-less opposed an env issue.

Does anyone have any insights into cause of this?

0 likes
9 replies
booni3's avatar

For anyone else having the issue, I solved one part of this with Flare (thanks to Flare support) with the following logging config:

'vapor' => [
    'driver' => 'stack',
    'channels' => ['flare', 'stderr'],
    'ignore_exceptions' => false,
],

Then define the logging channel in your env

2 likes
booni3's avatar

So AWS cloudwatch is already capturing all the logs (along with all the Lambda stuff too, that we do not really care about). There appear to be a few packages that are designed to forward from cloudwatch (which has a fairly quite interface!) through to papertrail. For example:

https://github.com/kenperkins/winston-papertrail

I am not too sure how to go about hooking something like this up though.

booni3's avatar

I got a reply from Taylor on Vapor. He told me that all logs are stored within cloudwatch... so it seems like at least for now this may be as far as it has been designed. For me, papertrail (or similar) with filtered, live tail logs has been extremely useful for both developing and debugging - especially big data crunching long running scripts in queues. I hope there is a work around to get this function working again with serverless!

aligajani's avatar

I am having the same issue. Papertrail doesn't work. Bugsnag works. Any ideas on how to log at all?

1 like
booni3's avatar

I went through a quite a few emails with papertrail and Taylor in regards to this. At least at a few months ago the answer was it is not compatible.

I would love to find a way to get paper trail to work!

fjarrett's avatar

hard to believe there's no mention of logging in the Vapor docs whatsoever...

booni3's avatar

The recommendation from the Vapor team currently is to use BugSnagg or Flare, but this does miss the point of application logging which is very useful to debug issues that do not cause exceptions.

Cloudwatch obviously logs the whole lot but compared to something like Papertrail its almost impossible to use it effectively.

You can connect Cloudwatch to papertrail, via a few methods as detailed here:

https://help.papertrailapp.com/kb/hosting-services/amazon-cloudwatch/

I have not tried this just yet though.

Please or to participate in this conversation.