当前位置: 首页>>代码示例>>C#>>正文


C# Log.Save方法代码示例

本文整理汇总了C#中Log.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Log.Save方法的具体用法?C# Log.Save怎么用?C# Log.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Log的用法示例。


在下文中一共展示了Log.Save方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: QuickSave

 private static void QuickSave(int type, string title,string message)
 {
     Log l = new Log();
     l.Type = type;
     l.Title = title;
     l.Message = message;
     l.Save("", DateTime.Now.AddHours(SiteSettings.Get().TimeZoneOffSet));
 }
开发者ID:chartek,项目名称:graffiticms,代码行数:8,代码来源:Log.cs

示例2: AddLog

        public bool AddLog(List<LogEvent> logList)
        {
            using (IConnectinContext context = DBContext.Context1)
            {
                context.BeginTransaction();

                foreach (var logEvent in logList)
                {
                    Log log = new Log();
                    logEvent.MemberCopyTo(log);
                    log.ErrorTime = Convert.ToDateTime(logEvent.ErrorTime);
                    log.CreatedTime = DateTime.Now;
                    log.Save();

                    AddLogInnerException(logEvent.Errors, log.ID);
                }
                context.Commit();

                return true;
            }
        }
开发者ID:priceLiu,项目名称:logMGT,代码行数:21,代码来源:LogManager.cs

示例3: Logon

        public bool Logon(string login, string senha)
        {
            if (string.IsNullOrEmpty(login)) return false;
            if (string.IsNullOrEmpty(senha)) return false;

            this.Login = login;
            this.Senha = senha;
            this.Get();
            if (this.IDUsuario == null) return false;
            if (!this.Ativo) return false;
            AdicionaSessao();

            if (Cliente.Current() != null)
            {
                var log = new Log();
                log.Descricao = "Usuário " + this.Login + " acessou o sitema em " + DateTime.Now.ToString("dd/MM/yyyy HH:mm");
                log.Usuario = this;
                log.Cliente = Cliente.Current();
                log.Programa = Programa.Current();
                log.Campanha = Campanha;
                log.Tipo = TipoLog.Login;
                log.Data = DateTime.Now;
                log.Save();
            }

            return true;
        }
开发者ID:Didox,项目名称:MVC_e_Velocit_app,代码行数:27,代码来源:Usuario.cs

示例4: Insert

        public void Insert(DateTime LogDate,string Message,byte MessageType,string UserAgent,string RemoteHost,string AuthUser,string Referer,string MachineName,string FormData,string QueryStringData,string CookiesData,string ExceptionType,string ScriptName,string ExceptionMessage,string ExceptionSource,string ExceptionStackTrace)
        {
            Log item = new Log();

            item.LogDate = LogDate;

            item.Message = Message;

            item.MessageType = MessageType;

            item.UserAgent = UserAgent;

            item.RemoteHost = RemoteHost;

            item.AuthUser = AuthUser;

            item.Referer = Referer;

            item.MachineName = MachineName;

            item.FormData = FormData;

            item.QueryStringData = QueryStringData;

            item.CookiesData = CookiesData;

            item.ExceptionType = ExceptionType;

            item.ScriptName = ScriptName;

            item.ExceptionMessage = ExceptionMessage;

            item.ExceptionSource = ExceptionSource;

            item.ExceptionStackTrace = ExceptionStackTrace;

            item.Save(UserName);
        }
开发者ID:89sos98,项目名称:dashcommerce-3,代码行数:38,代码来源:LogController.cs

示例5: Write

        public static void Write(Cxt cxt, string type, string category, string message)
        {
            Log log = new Log(cxt, 0);

            log.Type = type;
            log.Category = category;
            log.Message = message;
            
            log.Save();
        }
开发者ID:Erls-Corporation,项目名称:Singularity1.0,代码行数:10,代码来源:Log.cs

示例6: Log

 public static void Log(string logType, string category, string description, string entityName="", int entityId = 0)
 {
     Log log = new Log();
     log.LogType = logType;
     log.Category = category;
     log.Description = description;
     log.EntityName = entityName;
     log.EntityId = entityId;
     log.InsertUserId = Provider.User.Id;
     log.Save();
 }
开发者ID:fizikci,项目名称:Cinar,代码行数:11,代码来源:Provider.cs


注:本文中的Log.Save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。