views:

44

answers:

2

Hi all,

I used log4net in a sample application based on tutorial here. It works very well. But when I use same code and configuration in my main application, nothing works. My application is based on Castle ActiveRecord that itself is based on NHibernate. Both Castle ActiveRecord and NHibernate uses log4net internally. I'm suspicious about conflict between my use of log4net and Castle/NHibernate use of log4net. Am I right? If yes how can solve the conflict?

Thanks In Advance

A: 

A conflict might arise if NHibernate or Castle ActiveRecord use a different log4net version. If all components (including your application) use the same log4net version then there should not be any problem.

Once you have verified that all components use the same log4net version and you still experience problems you can turn on internal debugging of log4net to find out what is going on.

Stefan Egli
tnks Stefan, it was not the case.
afsharm
A: 

No, there are no special requirements. The Castle ActiveRecord 2.1.1 release package includes all required dependencies including NHibernate.dll and log4net.dll so unless you overwrite something it's impossible to get the wrong/incompatible versions.

Mauricio Scheffer
@Mauricio, according to this link http://stackoverflow.com/questions/1800285/asp-net-mvc-castle-activerecord-show-sql-queries I got my logging with log4net to work. But now the problem is all logs of Castle/NHibernate is automatically logged in log file too. Size of the logfile grows into mega bytes in few minutes. How can I disable logging Castle while I want to use log4net for my own logging purposes?
afsharm
@afsharm: create another question for that.
Mauricio Scheffer