public NebuLogger(NebuLogOption nebulogOption, string categoryName) { _option = nebulogOption; _categoryName = categoryName; _connection = new HubConnectionBuilder() .WithUrl(_option.NebuLogHubUrl, httpconnectionoptions => { httpconnectionoptions.HttpMessageHandlerFactory = (handler) => { var newHandler = handler as HttpClientHandler; newHandler.ServerCertificateCustomValidationCallback = (request, cert, chain, errors) => { return(true); }; return(newHandler); }; }) // Frank 2020.09.07 已过时:asp.net core 2.2 //.AddJsonProtocol() //--- ASP.NET CORE 3.0 //.AddJsonProtocol() .AddMessagePackProtocol() .Build(); _connection.Closed += async(error) => { await Task.Delay(2000); await _connection.StartAsync(); }; _connection.StartAsync().Wait(); //Console.WriteLine("==============Nebulog init=============="); }
public NebuLogger(NebuLogOption nebulogOption, HubConnection hubConnection, string categoryName) { _option = nebulogOption; _connection = hubConnection; _categoryName = categoryName; }
public NebuLogProvider(IOptions <NebuLogOption> option) { _option = option.Value; }
public NebuLogWpfProvider(NebuLogOption nebulogOption, HubConnection hubConnection) { _option = nebulogOption; _connection = hubConnection; }
public static void UseNebuLogWpf <T>(this ILoggerFactory factory, NebuLogOption nebulogOption, HubConnection hubConnection) { factory.AddProvider(new NebuLogWpfProvider(nebulogOption, hubConnection)); }