Ejemplo 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);
        }
		public Log4NetActivityLog(string accountName, string profileName)
		{
			_accountName = accountName;
			_profileName = profileName;
			_log4NetFileRepository = ObjectFactory.GetInstance<ILog4NetFileRepository>();
			_path = ObjectFactory.GetInstance<IActivityLogPathProvider>();

			_loggersNames = new Dictionary<ActivityType, string>
			                	{
			                		{
			                			ActivityType.Errors,
			                			ActivityLoggerRegistry.ErrorLoggerName
			                			},
			                		{
			                			ActivityType.All,
			                			ActivityLoggerRegistry.ActivityLoggerName
			                			}
			                	};
		}
        public Log4NetActivityLog(string accountName, string profileName)
        {
            _accountName           = accountName;
            _profileName           = profileName;
            _log4NetFileRepository = ObjectFactory.GetInstance <ILog4NetFileRepository>();
            _path = ObjectFactory.GetInstance <IActivityLogPathProvider>();

            _loggersNames = new Dictionary <ActivityType, string>
            {
                {
                    ActivityType.Errors,
                    ActivityLoggerRegistry.ErrorLoggerName
                },
                {
                    ActivityType.All,
                    ActivityLoggerRegistry.ActivityLoggerName
                }
            };
        }
Ejemplo n.º 5
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;
 }
 public ActivityLoggerFactory(ILoggerFactory factory, Locker locker)
 {
     _factory = factory;
     _locker  = locker;
     _path    = ObjectFactory.GetInstance <IActivityLogPathProvider>();
 }
 private static ILog GetLogger(IActivityLogPathProvider path, string name, IPluginContext context)
 {
     return(LogManager.GetLogger(path.GetLogPathFor(context.AccountName.Value, context.ProfileName.Value, name)));
 }
 public TpLogManager(IActivityLogPathProvider path, IPluginContext context)
 {
     _path    = path;
     _context = context;
 }
		public ActivityLoggerFactory(ILoggerFactory factory, Locker locker)
		{
			_factory = factory;
			_locker = locker;
			_path = ObjectFactory.GetInstance<IActivityLogPathProvider>();
		}
		private string GetFileName(string accountName, string profileName, string fileName, IActivityLogPathProvider path)
		{
			return Folder.Combine(path.GetLogPathFor(accountName, profileName, fileName));
		}
		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;
		}
 public TpLogManager(IActivityLogPathProvider path, IPluginContext context)
 {
     _path = path;
     _context = context;
 }
Ejemplo n.º 13
0
 private string GetFileName(string accountName, string profileName, string fileName, IActivityLogPathProvider path)
 {
     return(Folder.Combine(path.GetLogPathFor(accountName, profileName, fileName)));
 }
		private static ILog GetLogger(IActivityLogPathProvider path, string name, IPluginContext context)
		{
			return LogManager.GetLogger(path.GetLogPathFor(context.AccountName.Value, context.ProfileName.Value, name));
		}