/// <summary>
 /// Configures failed request logging.
 /// </summary>
 /// <param name="configurator"></param>
 /// <param name="directory"></param>
 /// <returns></returns>
 public static AppHostSiteConfigurator UseFailedRequestLogging(this AppHostSiteConfigurator configurator, string directory)
 {
     configurator.Element.Elements("traceFailedRequestsLogging").Remove();
     configurator.Element.Add(new XElement("traceFailedRequestsLogging",
                                           new XAttribute("enabled", true),
                                           new XAttribute("directory", directory)));
     return(configurator);
 }
Exemple #2
0
        /// <summary>
        /// Adds a 'http' binding with the specified information.
        /// </summary>
        /// <param name="self"></param>
        /// <param name="host"></param>
        /// <param name="port"></param>
        /// <returns></returns>
        public static AppHostSiteConfigurator AddHttpsBinding(this AppHostSiteConfigurator self, string host, int port)
        {
            if (string.IsNullOrWhiteSpace(host))
            {
                throw new ArgumentException(nameof(host));
            }
            if (port < 1 || port > 65535)
            {
                throw new ArgumentOutOfRangeException(nameof(port));
            }

            return(self.AddBinding("https", $"*:{port}:{host}"));
        }