Hello all

Let me start saying that I know about nothing about log4net (even after trying 
to read documentation and trying to understand examples). So please forgive any 
incorrect wording. Based on examples, I've managed to let an application write 
to a remotingserver (sending to / listening on port 8085) and the 
remotingserver writes it nicely to a file.

I have modified the remotingserver example to a (windows) service and that also 
works fine.

Now I'm in need of this one remotingserver application to handle logs from 
different applications to different logfiles. The application side of things is 
not an issue, I think; just use another port.

But how do I write an application that contains multiple 'remotingservers' or 
one 'remotingserver' listening on different ports? Any pointers are at this 
stage appreciated. A thread for each port that I want to listen on? If so, how 
do I 'tell the thread' to use a specific configuration? Or something else.

Current code for remotingserver (in a windows service)

        protected override void OnStart(string[] args)
        {
            // TODO: Add code here to start your service.

            
System.Diagnostics.EventLog.WriteEntry(String.Format("dsrp_log4net_service", 
version.getVersion()),
                                          ServiceName + "starting");

            // Log an info level message
            if (log.IsInfoEnabled) log.Info(String.Format("dsrp_log4net_service 
v{0} started", version.getVersion()));

            // Configure remoting. This loads the TCP channel as specified in 
the .config file.
            
RemotingConfiguration.Configure(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile,
 false);

            // Publish the remote logging server. This is done using the 
log4net plugin.
            log4net.LogManager.GetRepository().PluginMap.Add(new 
log4net.Plugin.RemoteLoggingServerPlugin("LoggingSink"));

            
System.Diagnostics.EventLog.WriteEntry(String.Format("dsrp_log4net_service", 
version.getVersion()),
                                          ServiceName + "started");

        }


Thanks in advance for any help. WimS

Reply via email to