You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by "Franco, Raf [PRDBE Extern]" <RF...@PRDBE.jnj.com> on 2004/07/01 11:41:27 UTC

Problem with RemotingAppender and RemoteLoggingServerPlugin

I am trying to use the logging via remoting. I have one client exe and a
server exe. (Windows forms, .Net1.1, log4net version 1.2.0.30714)  The
server has a rollingfile logger, the client has to log via remoting to the
servers rolling file. Thats all I want to do.

These are part of my code to accomplish this. The problem is that I do not
get any erros and stil nothing works. Can anybody help me?

Client config file:
	<configSections>
		<section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
	</configSections>
	<log4net>
		<appender name="MyAppender"
type="log4net.Appender.RemotingAppender">
			<param name="Sink"
value="tcp://localhost:11000/AppenderSink" />
			<param name="Lossy" value="false" />
			<param name="BufferSize" value="20" />
			<param name="OnlyFixPartialEventData" value="true"
/>
		</appender>
		<root>
			<level value="ALL" />
			<appender-ref ref="MyAppender" />
		</root>
	</log4net>
	<system.runtime.remoting>
		<customErrors mode="off" />
		<application>
			<channels>
				<channel name="AppenderSink"
displayName="Server Channel" ref="tcp server" port="11000" />
			</channels>
		</application>
	</system.runtime.remoting>


Client code:
	log4net.Config.DOMConfigurator.Configure ();
	log=log4net.LogManager.GetLogger(typeof (Form1));
	log.Info ("Client application started.");


Server config file:
	<configSections>
		<section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
	</configSections>
	<log4net>
		<appender name="RollingFile"
type="log4net.Appender.RollingFileAppender">
		<file value="example.log" />
		<appendToFile value="true" />
		<maximumFileSize value="100KB" />
		<maxSizeRollBackups value="2" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%p %t %c - %m%n" />
		</layout>
		</appender>
		<root>
			<level value="DEBUG" />
			<appender-ref ref="RollingFile" />
		</root>
	</log4net>

Server code:
	log4net.Config.DOMConfigurator.Configure ();
	rlogserver=new
log4net.Plugin.RemoteLoggingServerPlugin("AppenderSink");
	rlogserver.Attach(log4net.LogManager.GetLoggerRepository());
	log=log4net.LogManager.GetLogger(typeof (Form1));
	log.Info ("Server application started.");
:

Thanks,
Raf