Hi,

As I understand it, you indicated that:

"The api it (your service) references has log4net logging in it but
requires the consumer to configure it and call the
XmlConfigurator.Configure() method to actually get logging running."


>From what I've researched, I found a sample source on how the
XmlConfigurator.Configure()  is used like so:

using Com.Foo;

// Import log4net classes.
using log4net;
using log4net.Config;

public class MyApp
{
    private static readonly ILog log =
LogManager.GetLogger(typeof(MyApp));

    static void Main(string[] args)
    {
        // BasicConfigurator replaced with XmlConfigurator.
        XmlConfigurator.Configure(new
System.IO.FileInfo(args[0]));    // <--- check this out

        log.Info("Entering application.");
        Bar bar = new Bar();
        bar.DoIt();
        log.Info("Exiting application.");
    }
}


Source: http://logging.apache.org/log4net/release/manual/configuration.html


You may want to check the link I have provided above. It looks to me
like you simply
need to create a config file that will be read by your service (which
would in turn uses
an api underneath which has log4net logging access).




Regards,


Benj






On Aug 28, 11:15 am, rbr <[email protected]> wrote:
> Hello,
>
> I have created a WCF service application that essentially is just an
> interface to an underlying api. So, this WCF service just contains
> the .svc file and web.config. The api it references has log4net
> logging in it but requires the consumer to configure it and call the
> XmlConfigurator.Configure() method to actually get logging running.
> Without adding code into my service, is there a way to get this going?
> The issue is that  I want to keep my service as code-free as possible
> and, from what I know, the only way to start the logging is with the
> XmlConfigurator.Configure() method call. Am I missing something?
>
> I'm sure I have left important details out so feel free to ask away.
>
> TIA!
>
> rbr

Reply via email to