Example #1
0
        protected override void OnStop()
        {
            if (_log.IsInfoEnabled)
            {
                _log.Info("Log4netRemotingServerService Stopping");
            }

            string isReadable = ConfigurationManager.AppSettings["log4net.Internal.Debug"];

            LogManager.GetRepository().PluginMap.Remove(_plugin);
            _plugin.Shutdown();
            _plugin = null;

            if (_log.IsInfoEnabled)
            {
                _log.Info("Log4netRemotingServerService Stopped");
            }
        }
Example #2
0
        protected override void OnStart(string[] args)
        {
            if (_log.IsInfoEnabled)
            {
                _log.Info("Log4netRemotingServerService Starting");
            }

            if (_plugin != null)
            {
                _plugin.Shutdown();
                _plugin = null;
            }

            _plugin = new log4net.Plugin.RemoteLoggingServerPlugin("Log4netRemotingServerService");

            // Publish the remote logging server. This is done using the log4net plugin.
            LogManager.GetRepository().PluginMap.Add(_plugin);

            if (_log.IsInfoEnabled)
            {
                _log.Info("Log4netRemotingServerService Started");
            }
        }