Inheritance: log4net.Appender.FileAppender
Esempio n. 1
0
 public PluginRollingFileAppender(PluginRollingFileAppender baseAppender, IActivityLogPathProvider path, Locker locker,
                                  string accountName, string profileName) : this()
 {
     _locker      = locker;
     _accountName = accountName;
     _profileName = profileName;
     Initialize(baseAppender, path);
 }
        public PluginRollingFileAppender(PluginRollingFileAppender baseAppender, IActivityLogPathProvider path,
		                                 string accountName, string profileName)
            : this()
        {
            _accountName = accountName;
            _profileName = profileName;
            Initialize(baseAppender, path);
        }
        protected virtual string GetLogFilePathFromLogger(Logger logger)
        {
            if (logger == null)
            {
                return(String.Empty);
            }

            PluginRollingFileAppender appender = logger.Appenders.OfType <PluginRollingFileAppender>().FirstOrDefault();

            if (appender != null)
            {
                return(appender.File);
            }

            return(String.Empty);
        }
Esempio n. 4
0
 private void Initialize(PluginRollingFileAppender baseAppender, IActivityLogPathProvider path)
 {
     Folder             = baseAppender.Folder;
     AppendToFile       = baseAppender.AppendToFile;
     CountDirection     = baseAppender.CountDirection;
     DatePattern        = CsvLayout.DATE_TIME_FORMAT;
     Encoding           = baseAppender.Encoding;
     ErrorHandler       = baseAppender.ErrorHandler;
     File               = GetFileName(_accountName, _profileName, baseAppender.File.GetFileName(), path);
     ImmediateFlush     = baseAppender.ImmediateFlush;
     Layout             = new CsvLayout();
     LockingModel       = new MinimalLock();
     MaxFileSize        = baseAppender.MaxFileSize;
     MaxSizeRollBackups = baseAppender.MaxSizeRollBackups;
     MaximumFileSize    = baseAppender.MaximumFileSize;
     Name               = path.GetLogPathFor(_accountName, _profileName, baseAppender.Name.GetFileName());
     RollingStyle       = baseAppender.RollingStyle;
     StaticLogFileName  = baseAppender.StaticLogFileName;
     Threshold          = baseAppender.Threshold;
 }
		private void Initialize(PluginRollingFileAppender baseAppender, IActivityLogPathProvider path)
		{
			Folder = baseAppender.Folder;
			AppendToFile = baseAppender.AppendToFile;
			CountDirection = baseAppender.CountDirection;
			DatePattern = CsvLayout.DATE_TIME_FORMAT;
			Encoding = baseAppender.Encoding;
			ErrorHandler = baseAppender.ErrorHandler;
			File = GetFileName(_accountName, _profileName, baseAppender.File.GetFileName(), path);
			ImmediateFlush = baseAppender.ImmediateFlush;
			Layout = new CsvLayout();
			LockingModel = new MinimalLock();
			MaxFileSize = baseAppender.MaxFileSize;
			MaxSizeRollBackups = baseAppender.MaxSizeRollBackups;
			MaximumFileSize = baseAppender.MaximumFileSize;
			Name = path.GetLogPathFor(_accountName, _profileName, baseAppender.Name.GetFileName());
			RollingStyle = baseAppender.RollingStyle;
			StaticLogFileName = baseAppender.StaticLogFileName;
			Threshold = baseAppender.Threshold;
		}