internal void CreateLogFolderIfNotFound() { if (!Directory.Exists(LogFolder)) { Directory.CreateDirectory(LogFolder); } LogConstants.ProvideFullAccess(LogFolder); }
private string GetLogXsltContent() { string applicationPath = LogConstants.GetSetupDir() + "\\"; string content = (string.IsNullOrWhiteSpace(logConfig.FileLogSource.LogXslt)) ? GetXmlEmbeddedResourceContent("log.xslt") : GetFileContent(applicationPath + logConfig.FileLogSource.LogXslt); return(AddXmlHeader(content)); }
public void Write( LogState state, string topic, string description, Exception exception = null, string user = "", string category = "", string custom = "") { string categoryValue = category; Logger logger = DefaultLogger; if (logger != null) { if ( (logger.Name == categoryValue) && (logger.Level < (int)LogConstants.GetLogLevel(state))) { return; } categoryValue = logger.Name; } if (user == string.Empty) { user = DefaultUser; } if (FileLog.IsEnabled) { lock (thisLock) { FileLog.WriteLog( state, StackInfo(state, exception), topic, description, categoryValue, user, custom); } } if (DbLog.IsEnabled) { DbLog.WriteLog( state, StackInfo(state, exception), topic, description, user, categoryValue, custom); } }
private static LogConfig GetLogConfig() { string path = LogConstants.GetSetupDir() + @"\logger.xml"; return(LogConstants.DeserializeLogConfig(path)); }
public Log(string configFilePath) { LogConfig logConfig = LogConstants.DeserializeLogConfig(configFilePath); Initialize(logConfig); }