mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 16:15:49 +03:00
[GH-ISSUE #909] New SlackWebookHandler and long context/extras problem #363
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#363
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mirfilip on GitHub (Jan 5, 2017).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/909
Hi,
I just got around to test the new cool SlackWebhookHandler. It works nice and fixes problems I had before, there is however one annoyance I found. @an1zhegorodov I didn't want to continue discussion in your original PR though.
I use attachments and include context and extra data. Depending on the length of the context, it's either formatted well or cut:
Looking good:
the whole nested array is displayed in code block (using "```").
If I, however, make it bigger:
The context output is truncated and the whole code block is broken. Below, it's how it looks like at the beginning of the msg (I don't include full msg cause it's big):

You can see at the beginning that there is no closing "```" of code block (probably because truncation). I don't have time to debug this now, it could be as well a limitation of Slack Webhook formatting.
What I'm trying to do:
I want to include a stacktrace (not based on exception) in a context so that it's prettified and displayed in code block on Slack. The
NormalizerFormatterand "stringification" get the job done, but only for small contexts.@mintobit commented on GitHub (Jan 7, 2017):
After debugging this, I can tell there is limitation somewhere around 2000 symbols for each attachment imposed by slack itself. Any ideas how to handle this?
@acasademont commented on GitHub (Jan 23, 2017):
AFAIK there are no limits when using the normal
messagefield instead of attachments, which is the weirdest thing ever...@Seldaek commented on GitHub (Mar 12, 2017):
Maybe you could truncate the output by hand to make sure the backticks is present at the end, or at least report it to slack so that they fix their truncation to not rip apart a code block..
@mirfilip commented on GitHub (Mar 12, 2017):
@Seldaek I hope by you, you mean me - the user of the library. Then - yes, I could, I already do that since I found out about the limitation.
I didn't have time to look into it but I'll get around to reporting it someday ;)
@Seldaek commented on GitHub (Mar 13, 2017):
@mirfilip By you I mean anyone running into this issue that feels like fixing it in monolog, or in slack :)
@gmponos commented on GitHub (Nov 29, 2018):
Because I had to deal with the same issue I have created this package. You can find it also in wiki of monolog.