IVilson.Utils.Logger.SignalR
1.0.5
dotnet add package IVilson.Utils.Logger.SignalR --version 1.0.5
NuGet\Install-Package IVilson.Utils.Logger.SignalR -Version 1.0.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IVilson.Utils.Logger.SignalR" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IVilson.Utils.Logger.SignalR" Version="1.0.5" />
<PackageReference Include="IVilson.Utils.Logger.SignalR" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add IVilson.Utils.Logger.SignalR --version 1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: IVilson.Utils.Logger.SignalR, 1.0.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=IVilson.Utils.Logger.SignalR&version=1.0.5
#tool nuget:?package=IVilson.Utils.Logger.SignalR&version=1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
on server side
using IVilson.Utils.Logger.SignalR;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddSignalR();
builder.Services.AddControllersWithViews();
var app = builder.Build();
app.Services.AddSignalRLogger(o =>
{
o.LogLevel = LogLevel.Information;
o.GroupName = "SignalRLogger"; // group name
});
app.MapHub<SignalRLoggerHub>(SignalRLoggerHub.HubUrl);
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.Run();
on client side:
const [logContent, setLogContent] = useState('');
useEffect(() => {
const connection = new HubConnectionBuilder()
.withUrl('/loghub')
.withAutomaticReconnect()
.build();
//use server group name
connection.start()
.then(() => console.log('SignalR Connected.'))
.then(() =>
connection.invoke('JoinGroup', "SignalRLogger")).then(()=>setLogContent(' '))
.catch(err => console.error('Connection failed: ', err));
connection.on('Broadcast', (message) => {
setLogContent(prev => `${prev}\n${message}`);
});
return () => connection.stop();
}, []);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Microsoft.AspNetCore.SignalR.Core (>= 1.2.0)
- Microsoft.Extensions.Logging (>= 9.0.3)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.3)
- Microsoft.Extensions.Logging.Configuration (>= 9.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.