Ejemplo n.º 1
0
        public QueueLogger(Log4ALAAppender appender)
        {
            this.tokenSource      = new CancellationTokenSource();
            this.cToken           = tokenSource.Token;
            this.manualResetEvent = new ManualResetEvent(false);
            this.appender         = appender;
            Queue          = new BlockingCollection <string>(appender.LoggingQueueSize != null && appender.LoggingQueueSize > 0 ? (int)appender.LoggingQueueSize : ConfigSettings.DEFAULT_LOGGER_QUEUE_SIZE);
            SharedKeyBytes = Convert.FromBase64String(appender.SharedKey);

            WorkerThread              = new Thread(new ThreadStart(Run));
            WorkerThread.Name         = $"Azure Log Analytics Log4net Appender ({appender.Name})";
            WorkerThread.IsBackground = true;
            WorkerThread.Priority     = (ThreadPriority)Enum.Parse(typeof(ThreadPriority), appender.ThreadPriority);
            if (ConfigSettings.IsLogQueueSizeInterval)
            {
                CreateLogQueueSizeTimer();
            }
        }
Ejemplo n.º 2
0
 public LoggingEventSerializer(Log4ALAAppender appender)
 {
     this.appender = appender;
 }