// Token: 0x06002541 RID: 9537 RVA: 0x00086686 File Offset: 0x00084886 public static void AppendToLog(ILogEvent logEvent) { if (OwaServerLogger.instance != null) { OwaServerLogger.instance.LogEvent(logEvent); } }
private void HandleLogEvent(object obj, ILogEvent aLog) { if (aLog.Priority >= logLevel) { Console.Out.WriteLine("NxBRE LOG " + aLog.Priority + " MSG : " + aLog.Message); } }
public void Write(ILogEvent @event) { if (@event is LogEvent e) { Write(e); } }
// Token: 0x0600252B RID: 9515 RVA: 0x000864E0 File Offset: 0x000846E0 public static void AppendToLog(ILogEvent logEvent) { if (OwaClientTraceLogger.instance != null) { OwaClientTraceLogger.instance.LogEvent(logEvent); } }
private void HandleLogEvent(object obj, ILogEvent aLog) { if (aLog.Priority >= LOG_LEVEL) { Console.WriteLine("[" + aLog.Priority + "] " + aLog.Message); } }
public void Prepare(ILogEvent logEvent) { var context = HttpContext.Current; if (context == null || IsRequestResponseHidden(context)) return; var request = context.Request; if (request == null) return; Func<NameValueCollection> formGetter; Func<NameValueCollection> queryStringGetter; ValidationUtility.GetUnvalidatedCollections(HttpContext.Current, out formGetter, out queryStringGetter); var form = formGetter(); logEvent.Set(KEY_REQUEST_ID, request.GetRequestId()); logEvent.Set(KEY_REQUEST_IP, request.GetClientAddress()); logEvent.Set(KEY_REQUEST_METHOD, request.HttpMethod); logEvent.Set(KEY_REQUEST_URL, request.Url); logEvent.Set(KEY_REQUEST_REFERRER, request.UrlReferrer); logEvent.Set(KEY_REQUEST_AGENT, request.UserAgent); logEvent.Set(KEY_REQUEST_COOKIES, string.Join("; ", request.Cookies.AllKeys.Select(k => string.Format("{0} = '{1}'", k, request.Cookies[k].Value)))); logEvent.Set(KEY_REQUEST_POST, string.Join("; ", form.AllKeys.Select(k => string.Format("{0} = '{1}'", k, CensorePasswords && k.ToUpperInvariant().Contains("PASSWORD") ? "*******" : form[k])))); }
protected void HandleLogEvent(object obj, ILogEvent aLog) { if (aLog.Priority >= logThreshold) { Console.WriteLine("NxBRE LOG " + aLog.Priority + " MSG : " + aLog.Message); } }
public TimelineElement(ILogEvent logEvent, Point?fixedPoint = null, bool showMapIcon = true) { if (logEvent == null) { throw new ArgumentNullException(nameof(logEvent)); } if (fixedPoint.HasValue) { fixedEventPos = fixedPoint.Value; } Time = logEvent.Time; Event = logEvent; TimelineIcon = logEvent.LogIcon; try { MapIcon = logEvent.MapIcon; } catch (Exception e) { } if (MapIcon == null) { ShowMapIcon = false; } else { ShowMapIcon = showMapIcon; MapIcon.Width = 40; MapIcon.Height = 40; } }
public void Prepare(ILogEvent logEvent) { var context = HttpContext.Current; if (context == null || IsRequestResponseHidden(context)) { return; } var request = context.Request; if (request == null) { return; } Func <NameValueCollection> formGetter; Func <NameValueCollection> queryStringGetter; ValidationUtility.GetUnvalidatedCollections(HttpContext.Current, out formGetter, out queryStringGetter); var form = formGetter(); logEvent.Set(KEY_REQUEST_ID, request.GetRequestId()); logEvent.Set(KEY_REQUEST_IP, request.GetClientAddress()); logEvent.Set(KEY_REQUEST_METHOD, request.HttpMethod); logEvent.Set(KEY_REQUEST_URL, request.Url); logEvent.Set(KEY_REQUEST_REFERRER, request.UrlReferrer); logEvent.Set(KEY_REQUEST_AGENT, request.UserAgent); logEvent.Set(KEY_REQUEST_COOKIES, string.Join("; ", request.Cookies.AllKeys.Select(k => string.Format("{0} = '{1}'", k, request.Cookies[k].Value)))); logEvent.Set(KEY_REQUEST_POST, string.Join("; ", form.AllKeys.Select(k => string.Format("{0} = '{1}'", k, CensorePasswords && k.ToUpperInvariant().Contains("PASSWORD") ? "*******" : form[k])))); }
private void SecureAppend(ILogEvent logEvent) { if (BuildFile()) { CleanWriter(); } // TODO: Remove this file access to improve performance // TODO: Count bytes written in memory instead. // TODO: Maybe use a wrapper class above writer and file _file.Refresh(); if (_file.Exists && _file.Length > MaxLength) { CleanWriter(); RollFiles(); } if (_writer == null) { try { BuildWriter(); } catch (Exception e) when(e is IOException || e is UnauthorizedAccessException) { _locked = true; BuildFile(); BuildWriter(); } } _writer.WriteLine(_logFormatter.Format(_provider, logEvent)); }
/// <summary> /// Callback on logging. /// </summary> protected void OnLog(ILogEvent log) { // was the lock taken? if (_lock.TryTake) { // yes, write pending log messages while (_logs.TryDequeue(out log)) { _writer.Write(log); _writer.WriteLine(); } // write the current log message _writer.Write(log.Type); _writer.Write(Chars.Space); _writer.Write(log.Message); _writer.WriteLine(); _lock.Release(); } else { // enqueue the message _logs.Enqueue(log); ManagerUpdate.Control.AddSingle(Update); } }
/// <summary> /// default write method /// </summary> /// <param name="event"></param> public void Write(ILogEvent @event) { if (@event is StatisticEvent <int> e) { Write(e); } }
public void WriteLogEvent(ILogEvent logEvent) { if (LogFilter(logEvent)) { WriteToMedium(logEvent); } }
/// <summary> /// Write the ILogEvent to the Logs /// </summary> /// <param name="event"></param> public void Write(ILogEvent @event) { if (@event is ILogMessage e) { Write(e); } }
public void Save(string path, ILogEvent logEvent) { if (IsEnabled) { this._saver.Save(path, logEvent); } }
public void Save(ILogEvent logEvent) { if (IsEnabled) { this._saver.Save(logEvent); } }
public void WriteLogEvent(ILogEvent logEvent) { if (logEvent.Level >= _minLogLevel) { _textWriter.WriteLine(logEvent.ToString()); _textWriter.Flush(); } }
public void Render(ILogEvent logEvent, XElement message) { message.Add(new XElement("identity", new XAttribute("name", logEvent.TryGet(KEY_IDENTITY_NAME, null)), new XAttribute("authenticated", logEvent.TryGet(KEY_IDENTITY_AUTHENTICATED, null)), new XAttribute("type", logEvent.TryGet(KEY_IDENTITY_TYPE, null)) )); }
/// <summary> /// Formats the <see cref="ILogEvent" /> with the specified provider. /// </summary> /// <param name="provider">The provider.</param> /// <param name="logEvent">The log event.</param> /// <returns></returns> public string Format(ILogFormatProvider provider, ILogEvent logEvent) { var format = provider.GetFormat(); var formattedDate = FormatDate(logEvent.Date, provider.GetDateFormat()); return(string.Format(format, formattedDate, logEvent.Topic, logEvent.Level, logEvent.Message, logEvent.ThreadId, logEvent.ProcessId, logEvent.Id, logEvent.PreciseTimestamp)); }
/// <summary> /// Appends the <see cref="ILogEvent" /> asynchronously. /// </summary> /// <param name="logEvent">The log event.</param> /// <returns></returns> public Task AppendAsync(ILogEvent logEvent) { _events.Enqueue(logEvent); var task = _taskFactory.StartNew(OnAppend); _tasks.Enqueue(task); return(task); }
private void WritePerformanceData() { if (this.PerformanceTracker != null) { ILogEvent logEvent = this.PerformanceTracker.GetLogEvent(); base.WriteObject(ContactLinkingBaseCmdLet.CreateResultObject(this.Identity, logEvent)); } }
public void Prepare(ILogEvent logEvent) { var identity = Thread.CurrentPrincipal.Identity; logEvent.Set(KEY_IDENTITY_NAME, identity.Name); logEvent.Set(KEY_IDENTITY_AUTHENTICATED, identity.IsAuthenticated); logEvent.Set(KEY_IDENTITY_TYPE, identity.AuthenticationType); }
public bool Log(ILogEvent logEvent) { if (IsSendMessageRule(logEvent)) { _messageService.Send(MapToMessageEvent(logEvent)); } return(_logService.Log(logEvent)); }
public void PoolLogEvent(ILogEvent logEvent, int incrementPoolingSeconds = 60) { var incrementPoolingTimeSpan = new TimeSpan(0, 0, 0, incrementPoolingSeconds); _lastLogEventDateTime = DateTime.Now; _finishPoolingDateTime = _lastLogEventDateTime.Add(incrementPoolingTimeSpan); _logEvents.Enqueue(logEvent); Count++; }
/// <summary> /// Appends the specified log event. /// </summary> /// <param name="logEvent">The log event.</param> public void Append(ILogEvent logEvent) { if (_writer == null) { _writer = _factory.CreateStreamWriter(_file); _writer.AutoFlush = true; } _writer.WriteLine(_logFormatter.Format(_provider, logEvent)); }
/// <summary> /// Logs a new event. /// </summary> /// <param name="inData">The <c>LogEvent</c> object to send to the database.</param> /// <param name="debug">Optional parameter for printing HTTP response codes to the console (false by default).</param> public void Log(ILogEvent inData, bool debug = false) { inData.Data["session_n"] = flushIndex.ToString(); inData.Data["client_time"] = DateTime.Now.ToString(); flushIndex++; accruedLog.Add(inData); Flush(debug); }
private bool ContextFilter(ILogEvent logEvent) { var context = (IEventContext)eventContextTreeView.SelectedItem; if (context != null) { return(logEvent.Context.FullName.StartsWith(context.FullName)); } return(true); }
private void PrepareEvent(ILogEvent logEvent) { if (logEvent.IsSet(EVENT_PREPARED)) return; foreach (var interceptor in LogEventInterceptorProviders.Providers.GetInterceptors()) interceptor.Prepare(logEvent); logEvent.Set(EVENT_PREPARED, true); }
private MessageEvent MapToMessageEvent(ILogEvent logEvent) { return(new MessageEvent() { EventType = logEvent.EventType, PersonName = logEvent.PersonName, DateTime = logEvent.DateTime, To = new string[] { "Husband", "Wife", "Child" } }); }
private bool LevelFilter(ILogEvent logEvent) { var level = EventsLog.Levels.First(thisLevel => thisLevel.Name.ToLower() == logEvent.Level.ToLower()); if (!level.IsSelected) { return(false); } return(true); }
// TODO: reconsider the pattern of using a static constructor static DefaultLogger() { var ts = new TraceSource("SmartSync", SourceLevels.Critical | SourceLevels.Error | SourceLevels.Warning | SourceLevels.Verbose); LogEvent = EventLoggerFactory.CreateEventLogger <ILogEvent>(ts); }
public PooledLogEventQueue(ILogEvent firstLogEvent, int initialPoolingSeconds = 30) { var initialPoolingTimeSpan = new TimeSpan(0, 0, 0, initialPoolingSeconds); _firstLogEventDateTime = DateTime.Now; _lastLogEventDateTime = _firstLogEventDateTime; _finishPoolingDateTime = _firstLogEventDateTime.Add(initialPoolingTimeSpan); _logEvents.Enqueue(firstLogEvent); Count = 1; }
protected void ShowAllLogs(object obj, ILogEvent aLog) { Console.WriteLine("NxBRE Log " + aLog.Priority + " : " + aLog.Message); }
public void Write(ILogEvent logEvent) { Console.WriteLine(logEvent.Message); }
public void Prepare(ILogEvent logEvent) { logEvent.Set(KEY_MESSAGE_ID, Guid.NewGuid()); }
public void Render(ILogEvent logEvent, XElement message) { message.Add(new XAttribute("id", logEvent.TryGet(KEY_MESSAGE_ID, ""))); }
public void Write(ILogEvent logEvent) { Trace.WriteLine(logEvent); }
public void Prepare(ILogEvent logEvent) { logEvent.Set(KEY_RUN_ID, RunId); }
public void Render(ILogEvent logEvent, XElement message) { var requestElement = message.Element("request"); if (requestElement == null) { requestElement = new XElement("request"); } requestElement.SetAttributeValue("id", logEvent.TryGet(KEY_REQUEST_ID, null)); requestElement.SetAttributeValue("ip", logEvent.TryGet(KEY_REQUEST_IP, null)); requestElement.SetAttributeValue("method", logEvent.TryGet(KEY_REQUEST_METHOD, null)); requestElement.SetAttributeValue("url", logEvent.TryGet(KEY_REQUEST_URL, null)); requestElement.SetAttributeValue("referrer", logEvent.TryGet(KEY_REQUEST_REFERRER, null)); if (logEvent.IsSet(KEY_REQUEST_AGENT)) { var agentElement = requestElement.Element("agent"); if (agentElement == null) { agentElement = new XElement("agent"); requestElement.Add(agentElement); } agentElement.SetValue(logEvent.Get(KEY_REQUEST_AGENT)); } if (logEvent.IsSet(KEY_REQUEST_COOKIES)) { var cookiesElement = requestElement.Element("cookies"); if (cookiesElement == null) { cookiesElement = new XElement("cookies"); requestElement.Add(cookiesElement); } cookiesElement.SetValue(logEvent.Get(KEY_REQUEST_COOKIES)); } if (logEvent.IsSet(KEY_REQUEST_POST)) { var postElement = requestElement.Element("post"); if (postElement == null) { postElement = new XElement("post"); requestElement.Add(postElement); } postElement.SetValue(logEvent.Get(KEY_REQUEST_POST)); } if (requestElement.Parent == null && (!requestElement.IsEmpty || requestElement.Attributes().Any())) { message.Add(requestElement); } }
private void HandleLogEvent(object obj, ILogEvent aLog) { if (aLog.Priority >= logLevel) Console.Out.WriteLine("NxBRE LOG " + aLog.Priority + " MSG : " + aLog.Message); }
private void HandleLogEvent(object obj, ILogEvent aLog) { if (aLog.Priority >= LogEventImpl.DEBUG) Console.WriteLine("[" + aLog.Priority + "] " + aLog.Message); }
public void Write(ILogEvent logEvent) { if (Enabled) foreach (var provider in Providers) provider.Write(logEvent); }
public bool Includes(ILogEvent logEvent) { return events.ContainsKey(logEvent); }
public bool EventIsHidden(ILogEvent logEvent) { var context = logEvent.Context; if (context.ShowEvents != ShowEvents.Unknown) { return context.ShowEvents == ShowEvents.Yes ? false : true; } var isHidden = (!ReferenceEquals(logEvent, ReferenceLogEvent)) && HiddenMessages.Contains(logEvent.Message); if (!isHidden) { foreach (var eventContext in _cachedContexts) { if (eventContext.ShowEvents == ShowEvents.HideThisAndChildren) { if (eventContext.IsEqualOrParentOf(context)) { isHidden = true; context.ShowEvents = ShowEvents.HideThisAndChildren; break; } } } } if (context.ShowEvents != ShowEvents.Yes) { if (!_cachedContexts.Contains(context)) { _cachedContexts.Add(context); } if (!_hiddenContextsCache.Contains(context)) { _hiddenContextsCache.Add(context); } } return isHidden; }
public ILogSet[] GetSetsFor(ILogEvent logEvent) { return sets.FindAll(thisSet => thisSet.Includes(logEvent)).ToArray(); }
public void handleLogEvent(object obj, ILogEvent aLog) { logCount++; if ((aLog.Priority == 3) && (aLog.Message == ASSERTED_HELLO_VALUE)) foundDynamicLog = true; if (aLog.Priority >= 5) Console.Out.WriteLine("NxBRE LOG " + aLog.Priority + " MSG : " + aLog.Message); }
public void Render(ILogEvent logEvent, XElement Run) { Run.Add(new XAttribute("runId", logEvent.TryGet(KEY_RUN_ID, ""))); }
public void Write(ILogEvent logEvent) { }
protected void HandleLogEvent(object obj, ILogEvent aLog) { if (aLog.Priority >= logThreshold) Console.WriteLine("NxBRE LOG " + aLog.Priority + " MSG : " + aLog.Message); }