I re-jigged my whole logging framework so that the log4net code base remains untouched, and all my custom extensions are in a separate assembly. This approach has solved my problems. So, I recommend people leave the core log4net code alone. This is better design, makes upgrades easier, and would avoid any compatibility issues like I had.
Simon. ---------- Original Message ---------------------------------- From: "Simon Wallis" <[EMAIL PROTECTED]> Reply-To: <[EMAIL PROTECTED]> Date: Fri, 10 Dec 2004 08:34:03 -0600 >I think I'm narrowing down my problem. I believe it can't load the log4net >assembly because the version used by the code generating the event may be >different from the version used by the Remoting code handling the event. > >I'll post again when this is solved, just in case someone in the future gets >the same error. > >---------- Original Message ---------------------------------- >From: "Simon Wallis" <[EMAIL PROTECTED]> >Reply-To: <[EMAIL PROTECTED]> >Date: Thu, 9 Dec 2004 13:46:59 -0600 > >>Not sure what you mean. The client is not even aware that Remoting is being >>used since it is all done in log4net, which is a black box to the client. The >>client works with other appendes, just not the RemotingAppender. >> >>In the stack trace there is a message "Cannot find the assembly log4net". Not >>sure where that's coming from or why it would come up. >> >>Simon. >> >>---------- Original Message ---------------------------------- >>From: "Graham Allwood" <[EMAIL PROTECTED]> >>Reply-To: "Log4NET User" <[email protected]> >>Date: Thu, 9 Dec 2004 16:03:23 -0000 >> >>>Does your client have access to the exception class too? Just a shot in the >>>dark but with remoting the serialized assemblies have to be available to >>>both client and server. >>> >>>-----Original Message----- >>>From: Simon Wallis [mailto:[EMAIL PROTECTED] >>>Sent: 09 December 2004 15:16 >>>To: Log4NET User >>>Subject: RE: Error using RemotingAppender: can't find assembly log4net >>> >>>Now I'm using the example RemotingServer which works perfectly with the >>>example RemotingClient. It just bombs when I use it with my own client. Here >>>is the stack trace from DebugView which also shows the configuration of my >>>client. Again, the server works fine with the sample client, just not my >>>client. >>> >>>Doesn't this mean that the server is fine but something wrong with my client >>>setup? Why do you suppose it is giving the message, "Cannot find the >>>assembly log4net"? >>> >>>[7100] log4net: DOMConfigurator: Configuration update mode [Merge]. >>>[7100] log4net: DOMConfigurator: Logger [root] Level string is [DEBUG]. >>>[7100] log4net: DOMConfigurator: Logger [root] level set to >>>[name="DEBUG",value=30000]. >>>[7100] log4net: DOMConfigurator: Loading Appender [RemotingAppender] type: >>>[log4net.Appender.RemotingAppender] >>>[7100] log4net: DOMConfigurator: Setting Property [Sink] to String value >>>[tcp://localhost:8085/LoggingSink] >>>[7100] log4net: DOMConfigurator: Setting Property [Lossy] to Boolean value >>>[False] >>>[7100] log4net: DOMConfigurator: Setting Property [BufferSize] to Int32 >>>value [1] >>>[7100] log4net: DOMConfigurator: Setting Property [OnlyFixPartialEventData] >>>to Boolean value [True] >>>[7100] log4net: DOMConfigurator: Created Appender [RemotingAppender] >>>[7100] log4net: DOMConfigurator: Adding appender named [RemotingAppender] to >>>logger [root]. >>>[7100] log4net: DOMConfigurator: Hierarchy Threshold [] >>>[7100] log4net:ERROR [RemotingAppender] Failed in DoAppend >>>[7100] System.Runtime.Serialization.SerializationException: Cannot find the >>>assembly log4net, Version=1.2.0.30714, Culture=neutral, >>>PublicKeyToken=9be3b600b03054c9. >>>[7100] >>>[7100] Server stack trace: >>>[7100] at >>>System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembl >>>y() >>>[7100] at >>>System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAs >>>semblyInfo assemblyInfo, String name) >>>[7100] at >>>System.Runtime.Serialization.Formatters.Binary.BinaryConverter.TypeFromInfo( >>>BinaryTypeEnum binaryTypeEnum, Object typeInformation, ObjectReader >>>objectReader, BinaryAssemblyInfo assemblyInfo, InternalPrimitiveTypeE& >>>primitiveTypeEnum, String& typeString, Type& type, Boolean& isVariant) >>>[7100] at >>>System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadArray(Bina >>>ryHeaderEnum binaryHeaderEnum) >>>[7100] at >>>System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run() >>>[7100] at >>>System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(Head >>>erHandler handler, __BinaryParser serParser, Boolean fCheck, >>>IMethodCallMessage methodCallMessage) >>>[7100] at >>>System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(S >>>tream serializationStream, HeaderHandler handler, Boolean fCheck, >>>IMethodCallMessage methodCallMessage) >>>[7100] at >>>System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage >>>(String objectUri, Stream inputStream, Boolean bStrictBinding, >>>TypeFilterLevel securityLevel) >>>[7100] at >>>System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IS >>>erverChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders >>>requestHeaders, Stream requestStream, IMessage& responseMsg, >>>ITransportHeaders& responseHeaders, Stream& responseStream) >>>[7100] >>>[7100] Exception rethrown at [0]: >>>[7100] at >>>System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage >>>reqMsg, IMessage retMsg) >>>[7100] at >>>System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& >>>msgData, Int32 type) >>>[7100] at log4net.Appender.IRemoteLoggingSink.LogEvents(LoggingEvent[] >>>events) >>>[7100] at log4net.Appender.RemotingAppender.SendBuffer(LoggingEvent[] >>>events) >>>[7100] at log4net.Appender.BufferingAppenderSkeleton.Append(LoggingEvent >>>loggingEvent) >>>[7100] at log4net.Appender.AppenderSkeleton.DoAppend(LoggingEvent >>>loggingEvent) >>> >>> >>> >>>---------- Original Message ---------------------------------- >>>From: "Nicko Cadell" <[EMAIL PROTECTED]> >>>Reply-To: "Log4NET User" <[email protected]> >>>Date: Wed, 8 Dec 2004 19:18:17 -0000 >>> >>>>It looks like the exception is being generated by the remoting server in >>>>the ObjectReader.Deserialize methods. This is then being thrown back to >>>>the client. >>>> >>>>How have you setup the remoting server listening on 8085? >>>> >>>>Nicko >>>> >>>>> -----Original Message----- >>>>> From: Simon Wallis [mailto:[EMAIL PROTECTED] >>>>> Sent: 08 December 2004 19:08 >>>>> To: [email protected] >>>>> Subject: Error using RemotingAppender: can't find assembly log4net >>>>> >>>>> Hi, I'm trying to use the RemotingAppender. I got the client >>>>> and server sample code working fine. Now I'm trying to use >>>>> the appender in my own code but I'm getting an error that I >>>>> can't figure out. When I run my own app (acting as the >>>>> client) I see this stack trace in DebugView: >>>>> >>> >>><!-- snip --> >>> >>>> >>>>> >>>>> Here is my config: >>>>> >>>>> <appender name="RemotingAppender" >>>>> type="log4net.Appender.RemotingAppender" > >>>>> <sink value="tcp://localhost:8085/LoggingSink" /> >>>>> <lossy value="false" /> >>>>> <bufferSize value="1" /> >>>>> <onlyFixPartialEventData value="true" /> </appender> >>>>> >>>>> As far as I can see, it is exactly the same as the client >>>>> sample code (except mine is not in the app's .config file), >>>>> yet the sample code works and mine doesn't. Other appenders >>>>> work with my code, just not the RemotingAppender. >>>>> >>>>> Simon. >>>>> >>>>> >>>> >>> >>> >>> >> >
