Пример #1
0
        public void Register(string buildType, bool appendMessage = false)
        {
            var serverIp = IpHelper.GetLocalIPs();
            var sysInfo  = new
            {
                SysAppId   = ConfigItems.SysAppId,
                SysAppCode = ConfigItems.SysAppCode,
                SysAppName = ConfigItems.SysAppName,
                ServerIP   = serverIp,
                BuildType  = buildType,
            };
            var msg = $"register info is {sysInfo.ToJsonStr()}";

            AddLog(LogLevels.SysRegister, msg, serverIp: serverIp.FirstOrDefault(), appendMessage: appendMessage);
        }
Пример #2
0
        public void Offline(string buildType, Exception exception = null, bool appendMessage = false)
        {
            var serverIp = IpHelper.GetLocalIPs();
            var sysInfo  = new
            {
                SysAppId   = ConfigItems.SysAppId,
                SysAppCode = ConfigItems.SysAppCode,
                SysAppName = ConfigItems.SysAppName,
                ServerIP   = serverIp,
                BuildType  = buildType,
            };
            var msg = $"offline info is {sysInfo.ToJsonStr()}";

            AddLog(LogLevels.SysOffline, msg, exception: exception, serverIp: serverIp.FirstOrDefault(), appendMessage: appendMessage);
        }
Пример #3
0
        /// <summary>
        /// </summary>
        /// <param name="buildType"></param>
        /// <param name="appendMessage"></param>
        internal static void LogRegisterInfo(string buildType, bool appendMessage = false)
        {
            var serverIp = IpHelper.GetLocalIPs();
            var sysInfo  = new
            {
                ConfigItems.SysAppId,
                ConfigItems.SysAppCode,
                ConfigItems.SysAppName,
                ServerIP  = serverIp,
                BuildType = buildType
            };
            var msg = $"register info is {sysInfo.ToJsonStr()}";

            Add(msg, LogLevels.SysRegister, serverIp: serverIp.FirstOrDefault(), appendMessage: appendMessage);
        }