/// <summary>
        /// Sends the exception.
        /// </summary>
        /// <param name="ex">The ex.</param>
        /// <param name="bIgnoreTracker">if set to <c>true</c> [b ignore tracker].</param>
        public override void SendException(Exception ex, bool bIgnoreTracker = false)
        {
            var eventTracker = new TimeSpan(0, WorkManagerConfig.EventTracker, 0);

            if (bIgnoreTracker || TimeEventTracker.CanEvent((int)StringHash.BKDRHash(ex.Message), eventTracker))
            {
                // add additional information to the Exception Info.
                var additionalInfo = new NameValueCollection();
                additionalInfo.Add("Timestamp", DateTimeOffset.Now.ToString());
                additionalInfo.Add("Application Source", WorkManagerConfig.ApplicationName);

                ExceptionManagerContainer.Publish(ex, additionalInfo);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Namepaces the manager key.
 /// </summary>
 /// <param name="prefix">The prefix.</param>
 /// <param name="uri">The URI.</param>
 /// <returns></returns>
 private static int NamepaceManagerKey(string prefix, string uri)
 {
     return((int)StringHash.BKDRHash(string.Format("{0}:{1}", prefix, uri).ToLower()));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Files the key.
 /// </summary>
 /// <param name="fileName">Name of the file.</param>
 /// <param name="sectionName">Name of the section.</param>
 /// <param name="settingsSectionName">Name of the settings section.</param>
 /// <returns></returns>
 private static int FileKey(string fileName, string sectionName, string settingsSectionName)
 {
     return((int)StringHash.BKDRHash(string.Format("{0}.{1}.{2}", fileName, sectionName, settingsSectionName).ToLower()));
 }