Пример #1
0
        protected virtual void Dispose(bool disposing)
        {
            if (_commandsTransmitter == null)
            {
                return;
            }
            _commandsTransmitter.Stop();

            if (disposing && _commandsTransmitter != null)
            {
                _commandsTransmitter.Dispose();
                _commandsTransmitter = null;
            }
        }
Пример #2
0
        public void Loaded(DbConfigurationLoadedEventArgs loadedEventArgs,
                           DbConfigurationInterceptionContext interceptionContext)
        {
            var logger = new ExceptionLogger();

            _baseInfoQueue = new InfoQueue <BaseInfo>();
            var profiler = new DbProfiler(_baseInfoQueue)
            {
                AssembliesToExclude = new SortedSet <string>
                {
                    typeof(DbProfiler).Assembly.GetName().Name,
                    typeof(DatabaseLogger).Assembly.GetName().Name
                }
            };

            DbInterception.Add(new DatabaseInterceptor(profiler));
            _commandsTransmitter = new CommandsTransmitter(
                _baseInfoQueue, logger, new SimpleHttp(), _serverUri, LoggerPath.GetLogFileFullPath(_logFilePath));
            _commandsTransmitter.Start();
        }
Пример #3
0
        private DatabaseLogger()
        {
            AppDomain.MonitoringIsEnabled = true;
            var logger        = new ExceptionLogger();
            var baseInfoQueue = new InfoQueue <BaseInfo>();

            Profiler = new DbProfiler(baseInfoQueue)
            {
                AssembliesToExclude = new SortedSet <string>
                {
                    typeof(DbProfiler).Assembly.GetName().Name,
                    typeof(DatabaseLogger).Assembly.GetName().Name
                }
            };
            var serverUri           = new Uri(ConfigSetGet.GetConfigData("DNTProfilerServerUri"));
            var logFilePath         = ConfigSetGet.GetConfigData("DNTProfilerLogFilePath");
            var commandsTransmitter = new CommandsTransmitter(
                baseInfoQueue, logger, new SimpleHttp(), serverUri, LoggerPath.GetLogFileFullPath(logFilePath));

            commandsTransmitter.Start();
        }