Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EventLogTarget"/> class.
        /// </summary>
        internal EventLogTarget(IEventLogWrapper eventLogWrapper, IAppDomain appDomain)
        {
            _eventLogWrapper = eventLogWrapper ?? new EventLogWrapper();
            appDomain        = appDomain ?? LogFactory.CurrentAppDomain;

            Source           = appDomain.FriendlyName;
            Log              = "Application";
            MachineName      = ".";
            MaxMessageLength = EventLogMaxMessageLength;
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EventLogTarget"/> class.
        /// </summary>
        internal EventLogTarget(IEventLogWrapper eventLogWrapper, IAppDomain appDomain)
        {
            _eventLogWrapper = eventLogWrapper ?? new EventLogWrapper();
            appDomain        = appDomain ?? LogFactory.CurrentAppDomain;

            Source              = appDomain.FriendlyName;
            Log                 = "Application";
            MachineName         = ".";
            MaxMessageLength    = EventLogMaxMessageLength;
            OptimizeBufferReuse = GetType() == typeof(EventLogTarget);  // Class not sealed, reduce breaking changes
        }
Пример #3
0
 public WindowsLogger(IEventLogWrapper eventLog)
 {
     _eventLog = eventLog;
 }