-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
It is not straight forward to get a token to use monolog with Slack. The expectation is that you write an OAuth client to get the token, but it is possible to get it manually. These are the steps I followed today:
You should already have an account and a channel set up that you want to send error messages to.
- Create a new Slack App - https://api.slack.com/applications/new which will give you a client_id and a client_secret which you need for step two. You will need to enter a redirect URI, which can be any page for this purpose.
- Got to https://slack.com/oauth/authorize?client_id=[client_id]&scope=chat:write:bot
- Authorise App on the page that is returned.
- From the URI copy the code that is returned.
- Go to https://slack.com/api/oauth.access?client_id=[client_id]&client_secret=[client_secret]&code=[code]
- Your token is in the JSON that is displayed.
TO debug errors insert echo fread($this->resource, 1000); at the end of the writeToSocket method of Monolog/Handler/SocketHandler (see #514)
CyberLine, plandolt, EspadaV8, mintobit, cjke and 4 more