NLog.Contrib.Targets.WebSocketServer
NLog.Contrib.Targets.WebSocketServer is a NLog target that instead of writing on a file, or showing the log on the console, broadcast the log entries to the connected websocket connections. Features: - Fully integrated with NLog: it does not require changes in your application code beyond the configuration. - Self-hosted: it does not need IIS or any hosting framework, WebSocketListener is socket based. - Mono compatible: Both NLog and WebSocketListener are compatible with Mono. - Subscribe to Regular Expressions: Is it possible to send a message throug the WebSocket connection to indicate the expression to which you want to subscribe. Only log entries matching that regex will be sent. - Scalable: NLog and WebSocketListener components are decoupled by a producer-consumer pattern, so NLog will append the log entries to WebSocketServerTarget in O(1) time always, and another thread/threads are responsible of distributing that log entry to the clients. Still, if the component has a big number of connected clients, it may interfere with your application performance. See the MaxConnectedClients configuration setting.
Install
dotnet add package NLog.Contrib.Targets.WebSocketServer --version 1.0.0
Install-Package NLog.Contrib.Targets.WebSocketServer -Version 1.0.0
<PackageReference Include="NLog.Contrib.Targets.WebSocketServer" Version="1.0.0" />
Frameworks
No framework metadata available.
Dependencies
Adoption guide
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.
No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.
How to read this guidance
Sources: published NuGet v3 registry metadata and explicit NuBrowse editorial guides. Refresh: package metadata is refreshed from NuGet when the page loads. Limit: this is not a security, legal or compatibility guarantee; validate the selected version in your project.
Useful next steps
Move from package metadata to a concrete selection or review workflow.