Nick
Nick

Reputation: 19664

Configure Log4Net for NHibernate

This has got to be a lamer question:

In my test project I am attempting to configure log4net. The following method call gives the error.

BasicConfigurator.Configure();

"type name expected but method found"

What am I overlooking?

Thanks, Nick

Upvotes: 0

Views: 4068

Answers (3)

Nick
Nick

Reputation: 19664

oops.. I was trying to do this in the wrong context. I added the method call to my test project's constructor and we're good.

Upvotes: 0

Chris Brandsma
Chris Brandsma

Reputation: 11736

I'm not sure if linking to blog entries is verboten...

If you are trying to log NHibernate stuff, here is what I do:

How to show Log4Net info in NUnit (from NHibernate)

I also have a more basic getting started guide here:

Getting Started with Log4Net

Upvotes: 1

tvanfosson
tvanfosson

Reputation: 532445

Is this a compile time error or runtime error? Do you have a using log4net.Config statement in your class file? Does it still happen if you change it to reference the full class name?

log4net.Config.BasicConfigurator.Configure();

Upvotes: 1

Related Questions