Exemple #1
0
        public async Task OnILogging(DateTime time, string projectname, string sourcename, string loglevel, string message)
        {
            var nebulogMessage = new NebuLogMessageRequest()
            {
                TimeOfLog      = time,
                ProjectName    = projectname,
                SenderName     = sourcename,
                LogLevel       = loglevel,
                LoggingMessage = message
            };

            //===================================================================================
            // 如果将NebuLogHub宿主在WPF客户端中,可以通过Event方式将收到的log消息发送给前端进行显示,而不必通过桌面客户端注册SignalR.Client来获取消息。
            OnILoggingMessageReceived?.Invoke(this, nebulogMessage);
            //===================================================================================

            //Console.WriteLine($"=========={DateTime.Now}:: OnILogging {message} ============");
            await Clients.All.SendAsync("OnILogging", time.ToString("yyyy-MM-dd hh:mm:ss.fff"), projectname, sourcename, loglevel, message);

            var context = Context;
            var manager = Groups;
        }
Exemple #2
0
 public async Task OnNebuLogCustom(string username, NebuLogMessageRequest log)
 {
     await Clients.All.SendAsync("OnLogging", username, log);
 }