1

I have nearly completed my first ETL process that uses Rhino ETL, and I've been able to figure out the way to use the API by referring to the tests.

Great. I have data moving through the pipeline and being written to the db.

However I can't seem to figure out how to enable logging.

  • the log4net assemblies are there, the log4net object is being created
  • the WithLoggingMixin class seems to be doing its thing (although I must admit I'm a bit fuzzy on exactly what that is)
  • in the log4net.config file I have a follingFileAppender set up, and it contains the following:

But no log file is created. When I make a call to Debug() in my code it doesn't do anything because log.IsDebugEnabled is false.

What am I missing?

McDowell
  • 107,573
  • 31
  • 204
  • 267
nocache
  • 194
  • 1
  • 7

2 Answers2

5

In Rhino Etl 1.2.3, I was able to get logging to the console by adding the following to items the configuration section of the program's app.config file:

<configSections>
  <sectionGroup name="common">
    <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
  </sectionGroup>
</configSections>

<common>
  <logging>
    <factoryAdapter type="Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter, Common.Logging">
      <arg key="level" value="DEBUG" />
      <arg key="showLogName" value="true" />
      <arg key="showDataTime" value="true" />
      <arg key="dateTimeFormat" value="yyyy/MM/dd HH:mm:ss:fff" />
    </factoryAdapter>
  </logging>
</common>

To log to destinations other than the console, the Common.Logging documentation has information on how to wire up log4net.

Jonathan Little
  • 550
  • 7
  • 10
2

Okay. I dug through the [log4net documentation][1] and figured out a way to do it.

First of all I moved the log4net config into the App.config file (in a log4net section) and then executed

log4net.Config.XmlConfigurator.Configure();

during initialization. Now it works.


[1]: http://logging.apache.org/log4net/release/manual/configuration.html#.config Files "Apache log4net documentation"

nocache
  • 194
  • 1
  • 7