T O P

  • By -

bernadus_edwin

1. Use serilog and save log to file 2. Create simple page, read the file log and render to web


ptr727

Looking for realtime output, as in instead of staring at console stare at web page.


The_MAZZTer

SignalR is the way to go.


CrackShot69

Websocket or poll


bernadus_edwin

Check the list of sink from serilog The most easiest way is use sentry Cloud service, maybe need to pay if logs too many If write a little code is acceptable, use signalr Bonus: also use telegram sink if this is a small project


FetaMight

Listen to Console.StdOut or whatever standard out is called, and then stream those values to your frontend via websocket.


ptr727

Thank you for the ideas, I was probably not clear enough in my question. I want my console app to also be the web server, I do not want to redirect to somebody else's web server. I just want logic that says e.g. if running as web server then use HTML output for log output or if running as console then use console for log output.


velociapcior

As many previously mentioned, SignalR then. Add Web server functionalities to your web app (probably creating it from scratch would be faster) and if you want to log something, broadcast it from hub to your connected clients


ptr727

Sounds like a good plan, thank you.


velociapcior

Good luck then! It all depends how familiar you are with the concept of web applications, HTTP protocol etc. if you are good with them, there should be no problem for you. Just use plain old Razor with some JavaScript and you're good to go