logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject RE: Can't get logging output
Date Wed, 22 Jun 2005 21:45:31 GMT
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 <john.livermore@inginix.com> 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:rongrabowski@yahoo.com] 
> 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 <john.livermore@inginix.com> wrote:
> 
> > Forgive my ignorance here, but where do I find the log4net debug
> log?
> > 
> > 
> > -----Original Message-----
> > From: Ron Grabowski [mailto:rongrabowski@yahoo.com]
> > 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 <john.livermore@inginix.com> 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>
> > > 
> > > -----Original Message-----
> > > From: John Livermore [mailto:john.livermore@inginix.com]
> > > Sent: Wednesday, June 22, 2005 3:21 PM
> > > To: 'Log4NET User'
> > > Cc: John Livermore
> > > Subject: RE: Can't get logging output
> > > 
> > > Thanks for the response.
> > > 
> > > I did have an extra </appender> tag.  Removed that and gave
> > 'Everyone' 
> > > 'Full Control' access at the root of the hard drive.  That should
> 
> > > prevent security issues from being the problem.
> > > 
> > > Still no output.
> > > 
> > > Any other ideas? 
> > > 
> > > -----Original Message-----
> > > From: Ron Grabowski [mailto:rongrabowski@yahoo.com]
> > > Sent: Wednesday, June 22, 2005 2:58 PM
> > > To: Log4NET User
> > > Subject: Re: Can't get logging output
> > > 
> > > Some web servers require that the Network Service account have
> > write
> > > access to the directory were log files are stored. What happens
> > when
> > > you give Full Permission to the log directory for both the
> Network 
> > > Service account and the Asp.Net account?
> > > 
> > > I noticed that your config file had an extra </appender> tag.
> > > 
> > > What happens when you turn on internal debugging?
> > > 
> > > <appSettings>
> > >  <add key="log4net.Internal.Debug" value="true" /> </appSettings>
> 
> > > <system.diagnostics>  <trace>
> > >   <listeners>
> > >    <add 
> > >     name="textWriterTraceListener" 
> > >     type="System.Diagnostics.TextWriterTraceListener"
> > >    
> > >
> >
>
initializeData="C:\\BigWave\\bigwaveprojects.com\\Code\\Web\\log4net.txt"
> > > />
> > >    </listeners>
> > >  </trace>
> > > </system.diagnostics>
> > > 
> 
> 


Mime
View raw message