Exemplo n.º 1
0
        public static async Task <bool> InsertLogAsync(string type, object data)
        {
            var result = true;

            try
            {
                using (var client = new ConfigLogClient())
                {
                    var status = await client.InsertDefaultLogQueueAsync(type, JsonConvert.SerializeObject(data));

                    if (!status.Success)
                    {
                        status.ThrowIfException(true);
                        result = false;
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Log(Level.Error, $"通用日志==》InsertLog执行错误{ex}-{ex.InnerException}-{ex.StackTrace}");
            }
            return(result);
        }