I'm using Gibraltar for logging.
Is it possible to enable live logging (i.e. observe the logs in real time)? Currently, the only way to view the log seems to be to close the applic开发者_Python百科ation down.
Summary
- With v2.x (current version), its impossible for a console app, and possible with a WinForms app.
- With v3.0 (future version), it will be easy. This version is being released in a few months.
Details
The problem is that the current version of Gibraltar is really designed to collect logs behind the scenes, so they can be used to diagnose any application issues. Its not really designed to monitor live logs within an app (although this will change when v3.0 comes out - see below).
If you want a WinForms version with support for live logging, then you can press Ctrl-Alt-F5 to pop up a live logging console which is limited to the current process.
If you want to create a Console version with support for live logging support, I think you're out of luck: its not supported (it needs a windows form in the project for the message pump?). The only way to view the logs is to exit the app so it can flush its logs out.
The Gibraltar hub does offer limited support for live logging: if something happens in the app to trigger a log, the log is dumped to the Gibraltar hub which is then pushed to the Gibraltar analyst. However, its not exactly real time.
According to tech support, v3.0 of Gibraltar will have much better support for live logging, this will be released in a few months. I'm currently using SmartInspect, it seems to do the job.
We're happy to say that Gibraltar 3.0 shipped at the very end of March and has full support for live log viewing, even over weak connections. With Gibraltar 3.0 and later, once you set the configuration option to enable live viewing they will register themselves with the Hub. Then, when you decide you want to view the data from a specific instance of your application the connection will start streaming log data to you. You'll get the last thousand messages (or more, if you configure it that way) immediately and then updates in real time.
You can see a quick demo video of how this works on our blog: Live Sessions: New in Gibraltar 3.0
精彩评论