void OnEnable() { if (!cacheLogsWhenNotConnected) { LoggerFactory.AddAppender(send); } _socket.Connect(IPAddress.Parse(sendToIpAddress), port); }
void setupSOSMaxAppender() { var defaultFormatter = new DefaultLogMessageFormatter(); var socket = new SOSMaxAppender(); LoggerFactory.AddAppender(((logger, logLevel, message) => { message = defaultFormatter.FormatMessage(logger, logLevel, message); socket.Send(logLevel, message); })); socket.Connect(IPAddress.Loopback, 4444); }
static void clientSocketTest() { var defaultFormatter = new DefaultLogMessageFormatter(); var socket = new SOSMaxAppender(); LoggerFactory.AddAppender(((logger, logLevel, message) => { message = defaultFormatter.FormatMessage(logger, logLevel, message); socket.Send(logLevel, message); })); socket.Connect(IPAddress.Loopback, 4444); Thread.Sleep(50); }