Inheritance: SocketAppenderBase
示例#1
0
        void Awake()
        {
            _socket = new SOSMaxAppender();

            if (cacheLogsWhenNotConnected) {
                LoggerFactory.AddAppender(send);
            }
        }
示例#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 项目: sschmid/NLog
        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);
        }