예제 #1
0
        void OnEnable()
        {
            if (!cacheLogsWhenNotConnected)
            {
                LoggerFactory.AddAppender(send);
            }

            _socket.Connect(IPAddress.Parse(sendToIpAddress), port);
        }
예제 #2
0
        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);
        }
예제 #3
0
파일: Program.cs 프로젝트: qipa/NLog-1
        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);
        }