Example #1
0
        public LogQueue(LogClient logClient)
        {
            StackifyAPILogger.Log("Creating new LogQueue");

            _LogClient = logClient;
            _IsWebApp = System.Web.Hosting.HostingEnvironment.IsHosted;
            _MessageBuffer = new ConcurrentQueue<LogMsg>();
        }
        protected override void InitializeTarget()
        {
            _logClient = new LogClient("StackifyLib.net-nlog", apiKey, uri);
            if (!String.IsNullOrEmpty(globalContextKeys))
            {
                _GlobalContextKeys = globalContextKeys.Split(',').Select(s => s.Trim()).ToList();
            }

            if (!String.IsNullOrEmpty(mappedContextKeys))
            {
                _MappedContextKeys = mappedContextKeys.Split(',').Select(s => s.Trim()).ToList();
            }

            if (!String.IsNullOrEmpty(callContextKeys))
            {
                _CallContextKeys = callContextKeys.Split(',').Select(s => s.Trim()).ToList();
            }


            _HasContextKeys = _GlobalContextKeys.Any() || _MappedContextKeys.Any() || _CallContextKeys.Any();
        }
Example #3
0
 static Logger()
 {
     _LogClient = new LogClient("StackifyLib.net");
 }
        public override void ActivateOptions()
        {

            StackifyAPILogger.Log("ActiveOptions on log4net appender");

            try
            {
                if (!String.IsNullOrEmpty(globalContextKeys))
                {
                    _GlobalContextKeys = globalContextKeys.Split(',').Select(s => s.Trim()).ToList();
                }

                if (!String.IsNullOrEmpty(threadContextKeys))
                {
                    _ThreadContextKeys = threadContextKeys.Split(',').Select(s => s.Trim()).ToList();
                }

                if (!String.IsNullOrEmpty(logicalThreadContextKeys))
                {
                    _LogicalThreadContextKeys = logicalThreadContextKeys.Split(',').Select(s => s.Trim()).ToList();
                }

                if (!String.IsNullOrEmpty(callContextKeys))
                {
                    _CallContextKeys = callContextKeys.Split(',').Select(s => s.Trim()).ToList();
                }

                _HasContextKeys = _GlobalContextKeys.Any() || _ThreadContextKeys.Any() || _LogicalThreadContextKeys.Any() || _CallContextKeys.Any();


                _logClient = new LogClient("StackifyLib.net-log4net", apiKey, uri);
            }
            catch (Exception ex)
            {
                StackifyAPILogger.Log(ex.Message, true);
            }



            base.ActivateOptions();

        }