Hangfire.Console icon indicating copy to clipboard operation
Hangfire.Console copied to clipboard

Adding support for HTML logging.

Open plaisted opened this issue 8 years ago • 4 comments

Potential fix for issue https://github.com/pieceofsummer/Hangfire.Console/issues/14.

Allows the use of context.WriteHtmlLine(string message) in order to write raw (unencoded) HTML to the dashboard for use of links etc.

Sample image below using WriteHtmlLine to insert a link to elasticsearch query through Kibana to display all the structured log messaged from this Hangfire job.

image

plaisted avatar Jan 18 '17 03:01 plaisted

I don't like the idea of writing an unencoded html, because it can accidentally break the layout

pieceofsummer avatar Jan 19 '17 07:01 pieceofsummer

what if properties for label and src were created instead and it would always generate a structured 'a' tag?

datumgeek avatar Jan 19 '17 10:01 datumgeek

What about something similar to:

context.WriteLinks("Here is a {0} and another {1}", new HtmlLink { Text = "link", Url = "http://url" }, new HtmlLink { Text = "link here.", Url = "http://url2" });

Still allows you to format how to display the links but won't allow user to put unencoded HTML directly into dashboard.

plaisted avatar Jan 31 '17 05:01 plaisted

@plaisted - the url recognizer is really cool - you can't format the display, but it works great for linking to related data and to other related jobs :smile:

datumgeek avatar Jan 31 '17 09:01 datumgeek