private void SendLogAction(LoggingEvent loggingEvent)
        {
            //we should always format event in the same thread as
            //many properties used in the event are associated with the current thread
            //like threadname, ndc stacks, threadcontent properties etc.

            //initializing a string for the formatted log
            string _formattedLog = string.Empty;

            //if Layout is null then format the log from the Loggly Client
            if (this.Layout == null)
            {
                Formatter.AppendAdditionalLoggingInformation(Config, loggingEvent);
                _formattedLog = Formatter.ToJson(loggingEvent);
            }
            else
            {
                _formattedLog = Formatter.ToJson(RenderLoggingEvent(loggingEvent), loggingEvent.TimeStamp);
            }

            //check if logMode is bulk or inputs
            if (Config.LogMode == "bulk/")
            {
                addToBulk(_formattedLog);
            }
            else if (Config.LogMode == "inputs/")
            {
                //sending _formattedLog to the async queue
                LogglyAsync.PostMessage(_formattedLog, Config);
            }
        }
Exemple #2
0
        private void SendLogAction(LoggingEvent loggingEvent)
        {
            //we should always format event in the same thread as
            //many properties used in the event are associated with the current thread
            //like threadname, ndc stacks, threadcontent properties etc.

            //initializing a string for the formatted log
            string _formattedLog = string.Empty;

            //if Layout is null then format the log from the Loggly Client
            if (this.Layout == null)
            {
                Formatter.AppendAdditionalLoggingInformation(Config, loggingEvent);
                _formattedLog = Formatter.ToJson(loggingEvent);
            }
            else
            {
                _formattedLog = Formatter.ToJson(RenderLoggingEvent(loggingEvent), loggingEvent.TimeStamp);
            }

            //sending _formattedLog to the async queue
            ThreadPool.QueueUserWorkItem(x => Client.Send(Config, _formattedLog));
        }
Exemple #3
0
 protected override void Append(LoggingEvent loggingEvent)
 {
     Formatter.AppendAdditionalLoggingInformation(Config, loggingEvent);
     base.Append(loggingEvent);
 }
Exemple #4
0
 protected override void Append(LoggingEvent loggingEvent)
 {
     Formatter.AppendAdditionalLoggingInformation(Config, loggingEvent);
     Client.Send(Config, Config.InputKey, Config.UserAgent, Config.Tag, Formatter.ToJson(loggingEvent));
 }
Exemple #5
0
 private void SendLogAction(LoggingEvent loggingEvent)
 {
     Formatter.AppendAdditionalLoggingInformation(Config, loggingEvent);
     Client.Send(Config, Formatter.ToJson(loggingEvent));
 }