示例#1
0
        /// <summary>
        /// 创建日志记录器实例
        /// </summary>
        /// <param name="factory">logger工厂</param>
        /// <param name="endpoint">日志服务地址</param>
        /// <param name="secretId">Appid</param>
        /// <param name="secretKey">Appkey</param>
        /// <param name="logSetName">日志集名称</param>
        /// <param name="logTopicName">日志主题名称</param>
        /// <param name="period">保存天数</param>
        public CLSLogger(string name, ClsSetting setting, IExternalScopeProvider externalScopeProvider)
        {
            _name     = name ?? throw new ArgumentNullException(nameof(name));
            _settings = setting ?? throw new ArgumentNullException(nameof(setting));
            _externalScopeProvider = externalScopeProvider;
            var ipaddress = NetworkInterface.GetAllNetworkInterfaces().SelectMany(i => i.GetIPProperties().UnicastAddresses).FirstOrDefault(v => v.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).Address;

            if (ipaddress != null)
            {
                ip = ipaddress.ToString();
            }
        }
示例#2
0
 public ClsLoggerProvider(ClsSetting clsSetting)
 {
     settings = clsSetting;
 }