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

twoarmtom's avatar

Logging Errors with Slack

When my applications are installed via Forge errors logged using LOG_CHANNEL slack have a file path that allows me to identify which installation is having the error message:

/home/forge/*application_url*/vendor/...

With Vapor everything starts with var/task/:

/var/task/vendor/...

Is there a way to add information to the slack error log message? I've search and found no examples of adding more information to the config\logging.php file like this:

'slack' => [
            'driver' => 'slack',
            'url' => env('LOG_SLACK_WEBHOOK_URL'),
            'username' => "Laravel Log",
            'emoji' => ':boom:',
            'level' => 'error',
	// added variable
	    'message' => env('APP_INSTALL')
        ],

This didn't work, but it was worth a shot. Any suggestions on how to add information to identify the installation?

0 likes
0 replies

Please or to participate in this conversation.