/// <summary>
        /// Monitor MVC requests using the provided configuration settings
        /// </summary>
        /// <param name="configuration"></param>
        public UnhandledExceptionAttribute(MvcAgentElement configuration)
        {
            if (configuration == null)
                throw new ArgumentNullException("configuration");

            _configuration = configuration;
        }
        /// <summary>
        /// Monitor MVC requests using the provided configuration settings
        /// </summary>
        /// <param name="configuration"></param>
        public WebApiRequestMonitorAttribute(MvcAgentElement configuration)
        {
            if (configuration == null)
                throw new ArgumentNullException("configuration");

            _configuration = configuration;
        }
        /// <summary>
        /// Monitor MVC requests using the provided configuration settings
        /// </summary>
        /// <param name="configuration"></param>
        public MvcRequestMonitorAttribute(MvcAgentElement configuration)
        {
            if (configuration == null)
                throw new ArgumentNullException("configuration");

            _configuration = configuration;
            Order = 0; //so we run first and last in general
        }
Esempio n. 4
0
        /// <summary>
        /// Load the element from the system configuration file, falling back to defaults if it can't be parsed
        /// </summary>
        /// <returns>A new element object</returns>
        internal static MvcAgentElement SafeLoad()
        {
            MvcAgentElement configuration = null;

            try
            {
                //see if we can get a configuration section
                configuration = ConfigurationManager.GetSection("gibraltar/mvcAgent") as MvcAgentElement;
            }
            catch (Exception ex)
            {
                Log.Error(ex, LogCategory + ".Agent", "Unable to load the MVC Agent configuration from the config file",
                          "The default configuration will be used which will undoubtedly create unexpected behavior.  Exception:\r\n{0}", ex.Message);
            }

            return(configuration ?? new MvcAgentElement());
        }
 public MonitorRequestLogging(ActionExecutingContext actionContext, MvcAgentElement configuration)
 {
     _configuration = configuration;
     _context = new AgentActionContext(actionContext);
 }