KPixel wrote:
The messages go in a file. The configuration of log4net should be in your App.config. In production env, I set the debug level to "WARN" so that I get warnings and errors (which should never appear).
I'm now looking at the log4net configuration as several of you have pointed out, because of the potential overhead caused by the string concatenation. The code that I started with didn't configure log4net at all, resulting in an error message from log4net.
After I inserted the standard BasicConfigurator.Configure() call, I get loads of messages in my console window. Next I tried adding some XML to the App.config file as suggested above to configure log4net. This, however, doesn't seem to have any effect. Other ways to configure all failed in different ways. I tried many of the examples given by the log4net documentation, but these examples all seem to be for log4net version 1.2, whereas the log4net that came with NHibernate is version 1.1. There are considerable differences between these versions apparently, as most examples in the log4net documentation just don't compile.
The most basic example which I think should work is:
Code:
DOMConfigurator.Configure(new System.IO.FileInfo(@"\\NHibernate\\log4net.xml"));
However this results in: "log4net:ERROR DOMConfigurator: ConfigureFromXML called with null 'element' parameter" as if it didn't find the XML file. (Although I'm not sure if this is because of this added code, this seems the default message it gives when something is wrong.)
Trying something similar through the XmlConfigurator as given in the log4net examples doesn't work because XmlConfigurator is not defined.
Anyone any clue here? I suppose I'm a bit swamped by trying to use several things for the first time at once.