Slack: as_user or icon
drjonnicholson opened this issue · 2 comments
Hi,
I've noticed that when an exception logs through to slack it uses the default bot icon rather than the icon I've given the bot. Bit frustrating.
Looking at the documentation for slack it appears this is because as_user
setting is false by default and then it uses a default icon.
How can I add this setting to the slack notifier (and/or be able to customize the icon used by emoji/url)?
I dont personally use slack but try setting a value for iconEmoji
in the config
/**
* Slack settings
*/
'slack'=>[
'token' => env('SLACK_APP_TOKEN'), //https://api.slack.com/web#auth
'channel' => env('SLACK_CHANNEL', '#exceptions'), //Dont forget the '#'
'username' => env('SLACK_USERNAME', 'LERN'), //The 'from' name
'iconEmoji' => "Some value"
],
Thanks for the reply. Adding 'iconEmoji' => ":scream:"
worked. So as a workaround I have made a cusom emoji (https://get.slack.help/hc/en-us/articles/206870177-Creating-custom-emoji) with the image I want to use. Now I can successfully post with the expected icon, even if it's not actually using the icon assigned to the bot.
I dug into the code and this looks to be a limitation of the underlying monolog handler? Might be something to pass up the chain. But in any event my issue is resolved enough for me not to worry about it anymore - thanks for the help 😄