ewilliams0305 / WebLogger

Websocket server designed to provide a HTML command line interface on a dotnet Application.
MIT License
9 stars 4 forks source link

Read and Write Logs #4

Closed ewilliams0305 closed 1 year ago

ewilliams0305 commented 2 years ago

Either create a logging method and write a file. Or possible leverage the internal logging mechanisms and simply output to the websocket server.

neilsilver commented 1 year ago

@ewilliams0305 why don't we take the work you have done here and make it into a serilog custom sink.

That would handle the file storage outwith this project and leverage all of the serilog goodness!

I'd be happy to contribute !

ewilliams0305 commented 1 year ago

@neilsilver I actually have a pulled this into a private repo for work that I'm not "allowed to share". It's a bit larger now and includes a very rough sink. I'll pull the code back into this soon and see where that leads.

neilsilver commented 1 year ago

@ewilliams0305 cool let me know, we have most of our code in private repo's but I was encouraged by your OS approach and I think that if we create the sink as an OS and publish to nuget and I (maybe you) and others can consume it in our other softwares then we will have a vested interest in maintaining th OS portion.

I have writen this up as a Serilog sink and have done a few changes to support some auth , dynamic port allocation , encryption and support on device aswell as server. As i say im keen to open source it as much as possible!

ewilliams0305 commented 1 year ago

@neilsilver thats great, I'm generally in the boat. When it didn't get any traction I pulled a lot of it into our main repo. Working on this now, hopefully it doesn't trash too much of what you did. I created a netstandard 2.0 library and wrapped it on the 4.7.2 Crestron library. This was complete Ed so I could use the same code outside of the Crestron Land. There won't be too many broken public APIs and generally the only change will include a directory parameter in the constructor (removed GetApplixationRootDirectory from inside the library). I'll probably push it up shortly.

ewilliams0305 commented 1 year ago

@neilsilver separated the projects and created two nuget packages WebLogger and WebLogger.Crestron (need to clean up a bit). Refactored a bunch of stuff, so sorry that is basically a totally breaking solution change. Also created a dev branch. Check it all out. I also added params to the Write method to reduce boxing. There is also a new IWebLogger interface so this can be mocked. Check it out!

neilsilver commented 1 year ago

Ill take a look !