/// <summary> /// Attaches this plugin to a <see cref="ILoggerRepository"/>. /// </summary> /// <param name="repository">The <see cref="ILoggerRepository"/> that this plugin should be attached to.</param> /// <remarks> /// <para> /// A plugin may only be attached to a single repository. /// </para> /// <para> /// This method is called when the plugin is attached to the repository. /// </para> /// </remarks> override public void Attach(ILoggerRepository repository) { base.Attach(repository); // Create the sink and marshal it m_sink = new RemoteLoggingSinkImpl(repository); try { RemotingServices.Marshal(m_sink, m_sinkUri, typeof(IRemoteLoggingSink)); } catch (Exception ex) { LogLog.Error(declaringType, "Failed to Marshal remoting sink", ex); } }
/// <summary> /// Attaches this plugin to a <see cref="ILoggerRepository"/>. /// </summary> /// <param name="repository">The <see cref="ILoggerRepository"/> that this plugin should be attached to.</param> /// <remarks> /// <para> /// A plugin may only be attached to a single repository. /// </para> /// <para> /// This method is called when the plugin is attached to the repository. /// </para> /// </remarks> public override void Attach(ILoggerRepository repository) { base.Attach(repository); // Create the sink and marshal it m_sink = new RemoteLoggingSinkImpl(repository); try { RemotingServices.Marshal(m_sink, m_sinkUri, typeof(RemotingAppender.IRemoteLoggingSink)); } catch (Exception ex) { LogLog.Error("RemoteLoggingServerPlugin: Failed to Marshal remoting sink", ex); } }
public static void Main () { RemoteLoggingSinkImpl sink = new RemoteLoggingSinkImpl (); #if NET_2_0 RemotingConfiguration.Configure (AppDomain.CurrentDomain.SetupInformation.ConfigurationFile, false); #else RemotingConfiguration.Configure (AppDomain.CurrentDomain.SetupInformation.ConfigurationFile); #endif RemotingServices.Marshal (sink, "LoggingSink", typeof (IRemoteLoggingSink)); Console.ReadLine (); RemotingServices.Disconnect (sink); }
/// <summary> /// Attaches this plugin to a <see cref="ILoggerRepository"/>. /// </summary> /// <param name="repository">The <see cref="ILoggerRepository"/> that this plugin should be attached to.</param> /// <remarks> /// <para> /// A plugin may only be attached to a single repository. /// </para> /// <para> /// This method is called when the plugin is attached to the repository. /// </para> /// </remarks> override public void Attach(ILoggerRepository repository) { base.Attach(repository); // Create the sink and marshal it m_sink = new RemoteLoggingSinkImpl(repository); try { RemotingServices.Marshal(m_sink, m_sinkUri, typeof(log4net.Appender.RemotingAppender.IRemoteLoggingSink)); } catch(Exception ex) { LogLog.Error("RemoteLoggingServerPlugin: Failed to Marshal remoting sink", ex); } }
override public void Attach(ILoggerRepository repository) { base.Attach(repository); // Create the sink and marshal it m_sink = new RemoteLoggingSinkImpl(repository); try { RemotingServices.Marshal(m_sink, m_sinkUri, typeof(IRemoteLoggingSink)); } catch(Exception ex) { LogLog.Error(declaringType, "Failed to Marshal remoting sink", ex); } }
/// <summary> /// Is called when the plugin is to shutdown. /// </summary> /// <remarks> /// <para> /// When the plugin is shutdown the remote logging /// sink is disconnected. /// </para> /// </remarks> public override void Shutdown() { // Stops the sink from receiving messages RemotingServices.Disconnect(m_sink); m_sink = null; base.Shutdown(); }