The log file seems to be missing the messages about parsing the
<appender> node. Text like this is missing:

log4net: XmlHierarchyConfigurator: Loading Appender
[AspNetFileAppender] type: [log4net.Appender.FileAppender]
log4net: XmlHierarchyConfigurator: Setting Property [File] to String
value
[C:\\BigWave\\bigwaveprojects.com\\Code\\Web\\LogFileAppender.log]

You said you've already tested code like this correct?

string physicalFilePath =
"C:\\BigWave\\bigwaveprojects.com\\Code\\Web\\LogFileAppender.log";

try
{
 FileStream fileStream = 
  new FileStream(physicalFilePath, FileMode.Create, FileAccess.Write);
 if (fileStream != null && fileStream.CanWrite)
 {
  StreamWriter sw = new StreamWriter(fileStream);
  sw.Write(DateTime.Now.ToString());
 }
 else
 {
  Response.Write("Cannot open/write file [" + physicalFilePath + "] for
writing.");
 }
}
catch(Exception e)
{
 Response.Write("Error opening/writing file [" + physicalFilePath + "].
Cause: " + e.ToString();
}

You could try using this shorter notation:

 <file value="log4net.txt" />

That will create a file in the root of your website (i.e. in the same
folder as web.config).

- Ron

--- John Livermore <[EMAIL PROTECTED]> wrote:

> Ok, that seemed to do the trick as far as getting debug information. 
> Here
> is what was captured when I ran the app and hit a single logging
> statement.
> Can you tell if the configuration is getting read from this?
> 
> Thanks,
> John
> 
> log4net: log4net assembly [log4net, Version=1.2.9.0, Culture=neutral,
> PublicKeyToken=b32731d11ce58905]. Loaded from
> [c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net
>
files\root\3236e31e\31083b00\assembly\dl2\b2fca915\00a2828d_e02dc501\log4net
> .dll]. (.NET Runtime [1.1.4322.2032] on Microsoft Windows NT
> 5.1.2600.0)
> log4net: DefaultRepositorySelector: defaultRepositoryType
> [log4net.Repository.Hierarchy.Hierarchy]
> log4net: DefaultRepositorySelector: Creating repository for assembly
> [BigWave, Version=1.0.1999.24407, Culture=neutral,
> PublicKeyToken=null]
> log4net: DefaultRepositorySelector: Assembly [BigWave,
> Version=1.0.1999.24407, Culture=neutral, PublicKeyToken=null] Loaded
> From
> [c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net
>
files\root\3236e31e\31083b00\assembly\dl2\3fefaf7e\a9e01d48_6177c501\bigwave
> .dll]
> log4net: DefaultRepositorySelector: Assembly [BigWave,
> Version=1.0.1999.24407, Culture=neutral, PublicKeyToken=null] does
> not have
> a RepositoryAttribute specified.
> log4net: Delog4net: log4net assembly [log4net, Version=1.2.9.0,
> Culture=neutral, PublicKeyToken=b32731d11ce58905]. Loaded from
> [c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net
>
files\root\3236e31e\31083b00\assembly\dl2\b2fca915\00a2828d_e02dc501\log4net
> .dll]. (.NET Runtime [1.1.4322.2032] on Microsoft Windows NT
> 5.1.2600.0)
> log4net: DefaultRepositorySelector: defaultRepositoryType
> [log4net.Repository.Hierarchy.Hierarchy]
> log4net: DefaultRepositorySelector: Creating repository for assembly
> [BigWave, Version=1.0.1999.24407, Culture=neutral,
> PublicKeyToken=null]
> log4net: DefaultRepositorySelector: Assembly [BigWave,
> Version=1.0.1999.24407, Culture=neutral, PublicKeyToken=null] Loaded
> From
> [c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net
>
files\root\3236e31e\31083b00\assembly\dl2\3fefaf7e\a9e01d48_6177c501\bigwave
> .dll]
> log4net: DefaultRepositorySelector: Assembly [BigWave,
> Version=1.0.1999.24407, Culture=neutral, PublicKeyToken=null] does
> not have
> a RepositoryAttribute specified.
> log4net: DefaultRepositorySelector: Assembly [BigWave,
> Version=1.0.1999.24407, Culture=neutral, PublicKeyToken=null] using
> repository [log4net-default-repository] and repository type
> [log4net.Repository.Hierarchy.Hierarchy]
> log4net: DefaultRepositorySelector: Creating repository
> [log4net-default-repository] using type
> [log4net.Repository.Hierarchy.Hierarchy] 
> 
> -----Original Message-----
> From: Ron Grabowski [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 22, 2005 4:46 PM
> To: Log4NET User
> Subject: RE: Can't get logging output
> 
> The file shouldn't be zero bytes. It should contain a lot of debug
> information. Here's an example of what kind of information should be
> in the
> file (look for the "log4net: log4net assembly..." text):
> 
> http://tinyurl.com/a4dj6
>
http://www.mail-archive.com/log4net-user%40logging.apache.org/msg01894.html
> 
> Try turning autoFlush on by changing this line:
> 
>  <trace>
> 
> to:
> 
>  <trace autoflush="true">
> 
> If you still don't get output and you've verified that you can create
> an
> write your own files in that directory, you could open up a file
> yourself
> and tell the Framework that you want to redirect messages written to
> System.Diagnostics.Trace.Write to your file:
> 
> http://tinyurl.com/85m6b
>
http://www.mail-archive.com/log4net-user%40logging.apache.org/msg01051.html
> 
> --- John Livermore <[EMAIL PROTECTED]> wrote:
> 
> > Sorry, I missed that part of your post earlier.
> > 
> > The log4net.txt file gets created but has zero length.  I assume
> the 
> > test was just to see if a file would get written?
> > 
> > Now that I know I am getting a file written into the directory,
> what 
> > should I look at next?
> > 
> > Thanks,
> > John
> > 
> > -----Original Message-----
> > From: Ron Grabowski [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, June 22, 2005 4:06 PM
> > To: Log4NET User
> > Subject: RE: Can't get logging output
> > 
> > If you use the code in my original post, your log file should
> appear
> > in:
> > 
> >  C:\BigWave\bigwaveprojects.com\Code\Web\log4net.txt
> > 
> > You can also use DebugView from Sysinterals to view the Debug log
> on 
> > the local machine:
> > 
> >  http://www.sysinternals.com/MiscellaneousUtilities.html
> > 
> > without having to worry about the file being written to the file 
> > system.
> > 
> > You may also want to try creating a new file from within your code
> to 
> > verify that you do have write permissions in the directory.
> > 
> > --- John Livermore <[EMAIL PROTECTED]> wrote:
> > 
> > > Forgive my ignorance here, but where do I find the log4net debug
> > log?
> > > 
> > > 
> > > -----Original Message-----
> > > From: Ron Grabowski [mailto:[EMAIL PROTECTED]
> > > Sent: Wednesday, June 22, 2005 3:54 PM
> > > To: Log4NET User
> > > Subject: RE: Can't get logging output
> > > 
> > > What does the log4net debug log contain? Adding a TraceAppender
> is
> > not
> > > the same as adding a TextWriterTraceListener. When 
> > > log4net.Internal.Debug key is set to true, log4net records 
> > > initialization messages to Console.Out and 
> > > System.Diagnostics.Trace.Write. Adding a TextWriterTraceListener
> > will
> > > enable you to redirect this internal debug information to a text
> > file.
> > > This redirection is done by the .Net Framework, not log4net.
> > > 
> > > --- John Livermore <[EMAIL PROTECTED]> wrote:
> > > 
> > > > I changed my configuration for a different appender type
> (Trace).
> > 
> > > > Still no
> > > > output, so not a file issue or file security issue.
> > > > 
> > > > It seems like the configuration might not be getting read?  My 
> > > > AssemblyInfo contains...
> > > > 
> > > > [assembly: log4net.Config.XmlConfigurator(Watch=true)]
> > > > 
> > > > That makes log4net look in the web.config for the logging 
> > > > configuration correct?
> > > > 
> > > > Here is the new configuration...
> > > > 
> > > >         <log4net>
> > > >                 <appender name="LogFileAppender"
> > > > type="log4net.Appender.FileAppender">
> > > >                         <param name="File"
> > > >
> > >
> >
>
value="C:\\BigWave\\bigwaveprojects.com\\Code\\Web\\LogFileAppender.log"
> > > > />
> > > >                         <param name="AppendToFile" value="true" />
> > > >                         <layout type="log4net.Layout.PatternLayout">
> > > >                                 <param name="ConversionPattern"
> > > > value="%d{yyyy/MM/dd|HH:mm:ss.ff}|%t|%-5p|%-20c{2}|%x|%m%n" />
> > > >                         </layout>
> > > >                 </appender>
> > > >                 <appender name="TraceAppender"
> > > > type="log4net.Appender.TraceAppender">
> > > >                         <layout type="log4net.Layout.PatternLayout">
> > > >                                 <param name="ConversionPattern"
> > > > value="%d{yyyy/MM/dd|HH:mm:ss.ff}|%t|%-5p|%-20c{2}|%x|%m%n" />
> > > >                         </layout>
> > > >                 </appender>
> > > >                 <root>
> > > >                         <level value="INFO" />
> > > >                         <appender-ref ref="TraceAppender" />
> > > >                 </root>
> > > >         </log4net>
> > > > 
> 
=== message truncated ===

Reply via email to