The problem was that I was using version 1.1.1. You are using version 1.2.0 Beta 8.
Does anyone know when a non-beta version of 1.2.0 will be available. My code needs to go into production early July, so if a final release will be made available by then, I can use the Beta version till then, otherwise I'll have to figure out something else. Thanks, Ron. PS. Chad, Dag, thank you very much for all your time and effort. --- Chad Myers <[EMAIL PROTECTED]> wrote: > Attached are two zip files. One (log4nettest) is an > ASP.NET web app, the > other (logtest.zip) is a simple command-line app. > > To compile the cmd-line app, copy your log4net.dll > into the same dir as > the logtest.cs then run this from the command line: > > Csc /debug+ /r:log4net.dll logtest.cs > > Then run logtest.exe and it should create the two > logfiles. > > -Chad > > -----Original Message----- > From: Ronnie Hayden [mailto:[EMAIL PROTECTED] > Sent: Monday, May 31, 2004 10:28 AM > To: Log4NET User > Subject: RE: Independent FileAppenders > > I made the change, but it still doesn't work. It > still > writes to only MainLog. Could you please send your > sample application. > > I wish the problem was with VB .NET. I like C# much > more than I do VB .NET. > > Thanks, > > Ronnie. > > --- Chad Myers <[EMAIL PROTECTED]> wrote: > > Ah-hah! I spent way too much time on this, > > unfortunately, but the answer > > is quite simple: You're using VB.NET. heh, sorry, > I > > had to! No, > > seriously, the answer is really that your > > <appender-ref> tag is > > malformed. > > > > You have: > > <appender-ref name="OtherFeedLog"/> > > > > Should be: > > <appender-ref ref="OtherFeedLog"/> > > > > That fixed it for me in my sample test with your > > code. > > > > -Chad > > > > -----Original Message----- > > From: Ronnie Hayden > [mailto:[EMAIL PROTECTED] > > Sent: Sunday, May 30, 2004 11:43 PM > > To: Log4NET User > > Subject: RE: Independent FileAppenders > > > > I tried this. I am able to log to MainLog but not > to > > OtherLog. But when I add the OtherLogAppender to > > root, > > I am able to log to both logs (unfortunately not > > independently). I placed a breakpoint in the > > Application_Start method, where I call > > DOMConfigurator.Configure(), and it always hits > it. > > So > > that's also not a problem. > > > > I have included my code below. If anyone could > > please > > let me know what I am doing wrong, I would be very > > grateful. Please feel free to let me know if you > > have > > any questions regarding the code. > > > > Thanks, > > > > Ronnie. > > > > The log4net section of my web.config is as > follows: > > <log4net debug="false"> > > <appender name="MainLog" > > type="log4net.Appender.FileAppender,log4net" > > > <param name="File" > > value="C:\\Logs\\MainLog.txt" > > /> > > <param name="AppendToFile" value="true" /> > > <layout > > type="log4net.Layout.PatternLayout,log4net"> > > <param name="ConversionPattern" value="%d > > %-5p > > %m%n" /> > > </layout> > > </appender> > > <appender name="OtherFeedLog" > > type="log4net.Appender.FileAppender,log4net" > > > <param name="File" > > value="C:\\Logs\\OtherFeedLog.txt" /> > > <param name="AppendToFile" value="true" /> > > <layout > > type="log4net.Layout.PatternLayout,log4net"> > > <param name="ConversionPattern" value="%d > > %-5p > > %m%n" /> > > </layout> > > </appender> > > <root> > > <level value="DEBUG" /> > > <appender-ref ref="MainLog" /> > > </root> > > <logger name="OtherLogger" additivity="false"> > > <level value="DEBUG"/> > > <appender-ref name="OtherFeedLog"/> > > </logger> > > </log4net> > > > > I declare the logs as follows (in VB .NET): > > Private oMainLog As ILog = > > LogManager.GetLogger("MainLog") > > Private oOtherLog As ILog = > > LogManager.GetLogger("OtherLogger") > > > > I log messages like this: > > oMainLog.Info("Main Message") > > oMainLog.Warn("Main Message") > > oMainLog.Debug("Main Message") > > oMainLog.Error("Main Message") > > oMainLog.Fatal("Main Message") > > > > oOtherLog.Info("Other Message") > > oOtherLog.Warn("Other Message") > > oOtherLog.Debug("Other Message") > > oOtherLog.Error("Other Message") > > oOtherLog.Fatal("Other Message") > > > > I configure the logs by using the following code > in > > the Application_Start method in Global.asax.vb: > > log4net.Config.DOMConfigurator.Configure() > > > > > > --- Chad Myers <[EMAIL PROTECTED]> wrote: > > > Oops, I mean "have two different loggers log to > > two > > > different > > > independent log appenders". > > > > > > -Chad > > > > > > -----Original Message----- > > > From: Chad Myers [mailto:[EMAIL PROTECTED] > > > Sent: Saturday, May 29, 2004 9:11 AM > > > To: Log4NET User > > > Subject: RE: Independent FileAppenders > > > > > > What I was saying is that I have an app I'm > > > developing right now that > > > does exactly what you're trying to do, have two > > > different loggers log to > > > two different independent loggers (i.e. Logger1 > > goes > > > to foo.log and > > > Logger2 goes to bar.log) and it works just fine. > > > > > > I do it with a similar config to what you just > > > mentioned. > > > > > > Now, to answer your question... you can't get a > > > handle to appenders > > > (well, you can, but it's not intuitive and you > > > shouldn't need to do it > > > anyhow) like MainLog or OtherLog. All you need > to > > > care about is the > > > loggers such as "DataLogger" and all the other > > > loggers under root. > > > > > > With that config, these two statements should > > work: > > > > > > ILog defaultLog = LogManager.GetLogger("Blah"); > > > ILog dataLog = > LogManager.GetLogger("DataLogger"); > > > > > > defaultLog.Error("Test"); > > > dataLog.Error("Data Test"); > > > > > > After your app exits, you should notice that > > > MainLog.txt has "Test" in > > > it and OtherLog.txt has "Data Test" in it. > > > > > > -c > > > > > > -----Original Message----- > > > From: Ronnie Hayden > === message truncated === > ATTACHMENT part 2 application/x-zip-compressed name=Log4netTest.zip > ATTACHMENT part 3 application/x-zip-compressed name=logtest.zip __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/
