Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slack Attachment Width and Wrapping Issues

I'm trying to use slack attachments to log application errors but the large fields like the stack trace are behaving weirdly.

First, when using attachments the table seems to be fixed to some arbitrary width, is there anyway to change this so a wider value can be allowed? Otherwise 50+% of the slack window is blank, a complete waste. enter image description here

Using just text works fine, but there are a number of other smaller fields included that benefit from the field format.

Also I'm having a problem with slack doing strange wrapping when the message is large. Below is just a small snippet with a few characters falling off, but on the full stack there can be substantial loss.

Example (slack message builder) enter image description here

Adding a single character to the string and now it starts chopping things off (the text is all there and selectable, it's just doing a terrible job at wrapping.)

Example 2 enter image description here

Anyone have any suggestions to get something even slightly more useful?

like image 970
Wrightboy Avatar asked Jul 26 '16 16:07

Wrightboy


People also ask

Does Slack have a character limit?

Slack will truncate messages containing more than 40,000 characters. If you need to post longer messages, please consider uploading a snippet instead.

How do I indent text in Slack?

Blockquotes: To add angle brackets at the start of your message for indents and quotes, type ">" to indent a single lines or ">>>" to indent multiple paragraphs.

How do I send attachments in Slack API?

You must provide either a file or content parameter. The content of the file can either be posted using an enctype of multipart/form-data (with the file parameter named file ), in the usual way that files are uploaded via the browser, or the content of the file can be sent as a POST var called content .

How do I embed a message in Slack?

Tap and hold the message you'd like to share and select Share message. Tap the #channel name and choose where you'd like to share the message. Add an optional note, if you'd like.


1 Answers

I would suggest to upload the application errors as text file (Plain Text Snippet) instead putting the info into a message. That way you can post more data and the formatting is also better suited for this kind of data.

You can auto-share your uploaded file in a channel and it will appear as new message. You can also add comments to is if you want to convey more information.

Use the files.upload method to upload your error text as file with the filetype set to text to get a text snippet.

Here is an example how it looks like on Slack, when an app posts a new text snippet as described: Example for text snippet on Slack

like image 111
Erik Kalkoken Avatar answered Sep 19 '22 15:09

Erik Kalkoken