logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DWilli...@strohlsystems.com
Subject Re: File logging issues with website
Date Wed, 17 Nov 2004 19:06:53 GMT
You need to make sure that the log file is in a location that the ASPNET 
user has rights to write to.  By the looks of this config you are 
attempting to write to the System32 directory - which ASPNET does not have 
any rights to.





"Patten, Stephen" <Stephen.Patten@impaccompanies.com> 
11/17/2004 01:56 PM
Please respond to
"Log4NET User" <log4net-user@logging.apache.org>


To
"Log4NET User" <log4net-user@logging.apache.org>
cc

Subject
File logging issues with website






I’ve used log4net in quite a few windows services and forms projects but 
not a .Net website, and am experiencing problems writing to a file with 
this appender. Can someone help point me in the right direction?
 
Thank you,
Stephen
 
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 
      <configSections>
        <section name="log4net" type
="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
  </configSections>
 
      <appSettings>
 
      </appSettings>
 
 
 
 
 
 
 
 
  <system.web>
 
    <!--  DYNAMIC DEBUG COMPILATION
    <cache_sql table="CIS_CODES_CONTACT_TYPE" sql="select code_value, 
code_desc from cis.cis_codes where code_group = 'CONTACT_TYPE' and 
code_active = 1" />
          Set compilation debug="true" to insert debugging symbols (.pdb 
information)
 
          into the compiled page. Because this creates a larger file that 
executes
          more slowly, you should set this value to true only when 
debugging and to
          false at all other times. For more information, refer to the 
documentation about
          debugging ASP.NET files.
    -->
    <compilation defaultLanguage="vb" debug="true" />
 
    <!--  CUSTOM ERROR MESSAGES
          Set customErrors mode="On" or "RemoteOnly" to enable custom 
error messages, "Off" to disable. 
          Add <error> tags for each of the errors you want to handle.
    -->
    <customErrors defaultRedirect="error.aspx" mode="RemoteOnly" />
 
    <!--  AUTHENTICATION 
          This section sets the authentication policies of the 
application. Possible modes are "Windows", 
          "Forms", "Passport" and "None"
    -->
    <authentication mode="Windows" /> 
 
 
    <!--  AUTHORIZATION 
          This section sets the authorization policies of the application. 
You can allow or deny access
          to application resources by user or role. Wildcards: "*" mean 
everyone, "?" means anonymous 
          (unauthenticated) users.
    -->
    <authorization>
        <allow users="*" /> <!-- Allow all users -->
 
            <!--  <allow     users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
                  <deny      users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
            -->
    </authorization>
 
    <!--  APPLICATION-LEVEL TRACE LOGGING
          Application-level tracing enables trace log output for every 
page within an application. 
          Set trace enabled="true" to enable application trace logging. If 
pageOutput="true", the
          trace information will be displayed at the bottom of each page. 
Otherwise, you can view the 
          application trace log by browsing the "trace.axd" page from your 
web application
          root. 
    -->
    <trace enabled="false" requestLimit="10" pageOutput="false" traceMode
="SortByTime" localOnly="true" />
 
 
    <!--  SESSION STATE SETTINGS
          By default ASP.NET uses cookies to identify which requests 
belong to a particular session. 
          If cookies are not available, a session can be tracked by adding 
a session identifier to the URL. 
          To disable cookies, set sessionState cookieless="true".
    -->
    <sessionState 
            mode="InProc"
            stateConnectionString="tcpip=127.0.0.1:42424"
            sqlConnectionString="data source=127.0.0.1;user 
id=sa;password="
            cookieless="false" 
            timeout="20" 
    />
 
    <!--  GLOBALIZATION
          This section sets the globalization settings of the application. 

    -->
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
 
  </system.web>
 
      <log4net>
            <appender name="FileAppender" type
="log4net.Appender.FileAppender" >
                  <param name="File" value="ICLS.log" />
                  <param name="AppendToFile" value="true" />
                  <layout type="log4net.Layout.PatternLayout">
                        <conversionPattern value="%d{yyyMMdd:HHmmss.fffff} 
[%t] %-5p %c %x - %m%n" />
                  </layout>
            </appender>
            <appender name="SmtpAppender" type
="log4net.Appender.SmtpAppender">
                  <param name="To" value="spatten@impaccompanies.com" />
                  <param name="From" value="ICLS@impaccompanies.com" />
                  <param name="Subject" value="ICLS logging message" />
                  <param name="BufferSize" value="512" />
                  <param name="SMTPHost" value
="NBOMAIL01.impaccompanies.com" />
                  <param name="Lossy" value="false" />
                  <param name="LocationInfo" value="true" />
                  <filter type="log4net.Filter.LevelMatchFilter">
                              <param name="LevelToMatch" value="FATAL" />
                  </filter> 
                  <layout type="log4net.Layout.PatternLayout">
                        <conversionPattern value="%d{yyyMMdd:HHmmss.fffff} 
[%t] %-5p %c %x - %m%n" />
                  </layout>
            </appender>
 
            <!-- Setup the root category, add the appenders and set the 
default level -->
            <root>
                  <level value="ALL" />
                  <appender-ref ref="FileAppender" />
                  <appender-ref ref="SmtpAppender" />
            </root>
      </log4net>
 
</configuration>
 



IMPORTANT:  E-mails from this company normally contain confidential material for the sole
use of the intended recipient.  The use, distribution, transmittal or re-transmittal by an
unintended recipient of any communication is prohibited without our express approval in writing
or by e-mail.  If you are not the intended recipient please contact the sender and delete
all copies.  All e-mails sent to or from Strohl Systems are to be used for our business purposes
only.  E-mails sent from or to the company are subject to review by the company.
Mime
View raw message