在Javascript客户端中使用signalR。 (后端是asp.net核心)。
我想禁用控制台的Signalr日志记录。基本上,要停止此操作:
我已经做到了(但没有区别):
return p.getFriends().stream() //Stream<Profesor>
.sorted(Comparator.comparingInt(Profesor::getId)) //Stream<Profesor>
.map(P->P.favoritesByDist(0)) //Stream<Collection<CasaDeBurrito>>
.flatMap(Collection::stream) //Stream<CasaDeBurrito>
.distinct()
.collect(Collectors.toList()); //List<CasaDeBurrito>
有人请纠正我吗?
谢谢
答案 0 :(得分:0)
您只需要像这样将其添加到您的代码Duration.TotalHours([Your Hours])
中:
.configureLogging(signalR.LogLevel.None)
您可以在Microsoft Documentation中看到更多日志级别。
答案 1 :(得分:0)
我找到了禁用日志记录的方法。
import { ILogger, LogLevel, HubConnectionBuilder } from "@aspnet/signalr";
export class MyLogger implements ILogger {
log(logLevel: LogLevel, message: string) {
// Use `message` and `logLevel` to record the log message to your own system
}
}
// later on, when configuring your connection...
let connection = new HubConnectionBuilder()
.withUrl("/my/hub/url")
.configureLogging(new MyLogger())
.build();
这可能会帮助某人。