RE: Mystery concerning configuration SOLVED.
Actually, the file attribute on the node is processed by the .NET framework as a redirection to the given file. The attribute tells .NET to look for the actual definition of the section in the given file. log4net should be oblivious to this but it is not. The behavior seen is that log4net does read its configuration information from the specified file *but* it doesn't recognize those standard XML tags we log4net users have come to know and love. All it recognizes is . Of course, one could work around this--no functionality is prevented by this behavior--but it is rather awkward and unfriendly to work that way (especially if you're trying to do something like use schema directives for "intellisense"-like help). It is also much more readable to use the standard log4net schema and understandable to people who come onboard the project from other projects which have also used log4net. The take-away from this experience for me is that web.config redirections do not work nicely for log4net configuration. Though one can make them work, they exact a penalty. Better it is to just directly name that separate log4net config file when one initializes log4net. BTW, the best "intellisense" log4net schema I have found so far is from csharptest.net and is expressed as follows: http://csharptest.net/downloads/schema/lo g4net.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> If there is another one better, I would like to hear about it. Specifically, it would be nice if I could find such a schema at logging.apache.org ! == Eric == From: Ron Grabowski [mailto:rongrabow...@yahoo.com] Sent: Friday, June 19, 2009 1:49 PM To: Log4NET User Subject: Re: Mystery concerning configuration SOLVED. Log4net doesn't process the file attribute. I'm not sure how you're using it. These two nodes are processed identically during configuration: From: Eric Chamberlain To: Log4NET User Sent: Friday, June 19, 2009 12:56:34 PM Subject: RE: Mystery concerning configuration SOLVED. I have discovered the source of the problem. We had split out the configuration from the web.config but with a redirection left inside the web.config of the form: The file at the end was of the correct syntax and could be used by log4net but only to the extent that we used the elements. I have modified the program to initialized log4net directly from the split-out file and it works with full syntactical support. Go figure, eh? == Eric == From: Eric Chamberlain To: log4net-user@logging.apache.org Sent: Thursday, June 18, 2009 6:41:51 PM Subject: Mystery concerning configuration Greetings all, I have an appender which works fine if specified with generic XML but not when specified with conventional log4net terms in the configuration. Examples should help: The following works: But the following does *not* work. It fails to initialize (I turned on the log4net debugging to see it). It appears that log4net initialization does not recognized its own XML schema. How is that possible? __ Eric Chamberlain
Re: Mystery concerning configuration SOLVED.
Log4net doesn't process the file attribute. I'm not sure how you're using it. These two nodes are processed identically during configuration: From: Eric Chamberlain To: Log4NET User Sent: Friday, June 19, 2009 12:56:34 PM Subject: RE: Mystery concerning configuration SOLVED. I have discovered the source of the problem. We had split out the configuration from the web.config but with a redirection left inside the web.config of the form: The file at the end was of the correct syntax and could be used by log4net but only to the extent that we used the elements. I have modified the program to initialized log4net directly from the split-out file and it works with full syntactical support. Go figure, eh? == Eric == From:Eric Chamberlain To: log4net-user@logging.apache.org Sent: Thursday, June 18, 2009 6:41:51 PM Subject: Mystery concerning configuration Greetings all, I have an appender which works fine if specified with generic XML but not when specified with conventional log4net terms in the configuration. Examples should help: The following works: But the following does *not* work. It fails to initialize (I turned on the log4net debugging to see it). It appears that log4net initialization does not recognized its own XML schema. How is that possible? __ Eric Chamberlain
RE: Mystery concerning configuration SOLVED.
I have discovered the source of the problem. We had split out the configuration from the web.config but with a redirection left inside the web.config of the form: The file at the end was of the correct syntax and could be used by log4net but only to the extent that we used the elements. I have modified the program to initialized log4net directly from the split-out file and it works with full syntactical support. Go figure, eh? == Eric == From: Eric Chamberlain To: log4net-user@logging.apache.org Sent: Thursday, June 18, 2009 6:41:51 PM Subject: Mystery concerning configuration Greetings all, I have an appender which works fine if specified with generic XML but not when specified with conventional log4net terms in the configuration. Examples should help: The following works: But the following does *not* work. It fails to initialize (I turned on the log4net debugging to see it). It appears that log4net initialization does not recognized its own XML schema. How is that possible? __ Eric Chamberlain
Re: Mystery concerning configuration
WorksOnMyMachine class Program { static void Main(string[] args) { LogLog.InternalDebugging = true; LogLog.EmitInternalMessages = true; XmlDocument log4netConfig = new XmlDocument(); log4netConfig.LoadXml(@" "); ILoggerRepository rep = LogManager.CreateRepository(Guid.NewGuid().ToString()); XmlConfigurator.Configure(rep, log4netConfig["log4net"]); ILog log = LogManager.GetLogger(rep.Name, "Program"); log.Debug("Hello World"); } } From: Eric Chamberlain To: log4net-user@logging.apache.org Sent: Thursday, June 18, 2009 6:41:51 PM Subject: Mystery concerning configuration Greetings all, I have an appender which works fine if specified with generic XML but not when specified with conventional log4net terms in the configuration. Examples should help: The following works: But the following does *not* work. It fails to initialize (I turned on the log4net debugging to see it). It appears that log4net initialization does not recognized its own XML schema. How is that possible? __ Eric Chamberlain
Mystery concerning configuration
Greetings all, I have an appender which works fine if specified with generic XML but not when specified with conventional log4net terms in the configuration. Examples should help: The following works: But the following does *not* work. It fails to initialize (I turned on the log4net debugging to see it). It appears that log4net initialization does not recognized its own XML schema. How is that possible? __ Eric Chamberlain