logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicko Cadell" <ni...@neoworks.com>
Subject RE: Log4net does not works in production env
Date Fri, 23 Dec 2005 14:48:07 GMT
Do you get any output if you enable internal log4net debug and use the
sysinternals debugview?
http://logging.apache.org/log4net/release/faq.html#internalDebug
 
Cheers,
Nicko

> -----Original Message-----
> From: S. K Rahman [mailto:skrahman@gmail.com] 
> Sent: 23 December 2005 14:41
> To: log4net-user@logging.apache.org
> Subject: Log4net does not works in production env
> 
> Hello all,
> 
> I am facing a strange problem.
> The problem seems exactly like somebody posted earlier
> 
> -------------
> Logging is working fine on my dev machine but when I deploy 
> it does not do anything. I copied  the whole code on the 
> production machine and tried debugging it, it worked fine, I 
> go the logs.
> ---------
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=log4net-us
> er@logging.apache.org&msgId=1605998
> 
> I have enabled the log4net debug but it does not seems to 
> work as well. So I tried building log4net again in the 
> production server and used the binaries from build, but it 
> does not work either.
> 
> I am not sure how can I debug the problem. I tought that 
> problem to be permission related but it's not the case also 
> if I use process explorer from systeinternals.com I can see 
> the log4net dll loaded by w3wp.exe where as in my development 
> machine it is  aspnet_wp.exe My development machine is XP 
> where as production is Windows 2003.
> 
> I am trying to d log.debug("my message") from the asp.net code.
> 
> Here is the my log4net config and web.config
> 
> ---------
> <?xml version="1.0" encoding="utf-8" ?>
> <log4net debug="true">
> 	<appender name="LogFileAppender" 
> type="log4net.Appender.FileAppender" >
> 		<file value="mylog.Log" />
> 		<appendToFile value="true" />
> 		<layout type="log4net.Layout.PatternLayout">
> 			<conversionPattern value="%date 
> [%thread] %-5level %logger [%ndc] - %message%newline" />
> 		</layout>
> 	</appender>
> 	<appender name="HttpTraceAppender"
> type="log4net.Appender.AspNetTraceAppender" >
> 		<layout type="log4net.Layout.PatternLayout">
> 			<conversionPattern value="%date 
> [%thread] %-5level %logger [%ndc] - %message%newline" />
> 		</layout>
> 	</appender>
> 	<appender name="SmtpAppender" 
> type="log4net.Appender.SmtpAppender">
> 		<to value="myemailid@mydomain.com" />
> 		<from value="myemailid@mydomain.com" />
> 		<subject value="Logger message" />
> 		<smtpHost value="plex" />
> 		<bufferSize value="512" />
> 		<lossy value="true" />
> 		<evaluator type="log4net.Core.LevelEvaluator">
> 			<threshold value="DEBUG"/>
> 		</evaluator>
> 		<layout type="log4net.Layout.PatternLayout">
> 			<conversionPattern value="%newline%date 
> [%thread] %-5level %logger [%property{NDC}] - 
> %message%newline%newline%newline" />
> 		</layout>
> 	</appender>
> 	<appender name="RollingLogFileAppender"
> type="log4net.Appender.RollingFileAppender">
> 		<file value="CustomLogs\CustomLogs.log" />
> 		<appendToFile value="true" />
> 		<datePattern value="yyyyMMdd" />
> 		<rollingStyle value="Date" />
> 		<maxSizeRollBackups value="10" />
> 		<maximumFileSize value="5MB" />
> 		<rollingStyle value="Size" />
> 		<staticLogFileName value="true" />
> 		<layout type="log4net.Layout.PatternLayout">
> 			<conversionPattern value="%date 
> [%thread] %-5level %logger [%ndc] - %message%newline" />
> 		</layout>
> 	</appender>
> 	<root>
> 		<level value="DEBUG" />
> 		<appender-ref ref="LogFileAppender" />
> 		<appender-ref ref="HttpTraceAppender" />
> 		<appender-ref ref="SmtpAppender" />
> 		<!-- <appender-ref ref="RollingLogFileAppender" /> -->
> 		<appender-ref ref="RollingLogFileAppender" />
> 	</root>
> </log4net>
> -----------------
> 
> -------------
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
> 
>   <system.web>
> 
>     <!--  DYNAMIC DEBUG COMPILATION
>           Set compilation debug="true" to enable ASPX debugging. 
> Otherwise, setting this value to
>           false will improve runtime performance of this application.
>           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="c#"
>          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.
> 
>           "On" Always display custom (friendly) messages.
>           "Off" Always display detailed ASP.NET error information.
>           "RemoteOnly" Display custom (friendly) messages 
> only to users not running
>            on the local Web server. This setting is 
> recommended for security purposes, so
>            that you do not display application detail 
> information to remote clients.
>     -->
> 
>    <customErrors mode="RemoteOnly"/>
>    <!--
>       <error statusCode="500" redirect="/err500.aspx"/>
>       <error statusCode="404" redirect="/err04.aspx"/>
>       <error statusCode="403" redirect="/err403.aspx"/>
>       </customErrors>
>     -->
> 
> 
>     <!--  AUTHENTICATION
>           This section sets the authentication policies of 
> the application. Possible modes are "Windows",
>           "Forms", "Passport" and "None"
> 
>           "None" No authentication is performed.
>           "Windows" IIS performs authentication (Basic, 
> Digest, or Integrated Windows) according to
>            its settings for the application. Anonymous access 
> must be disabled in IIS.
>           "Forms" You provide a custom form (Web page) for 
> users to enter their credentials, and then
>            you authenticate them in your application. A user 
> credential token is stored in a cookie.
>           "Passport" Authentication is performed via a 
> centralized authentication service provided
>            by Microsoft that offers a single logon and core 
> profile services for member sites.
>     -->
>     <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="true"
>         requestLimit="50"
>         pageOutput="false"
>         traceMode="SortByTime"
> 		localOnly="false"
>     />
> 
>     <!--  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;Trusted_Connection=yes"
>             cookieless="false"
>             timeout="20"
>     />
> 
>     <!--  GLOBALIZATION
>           This section sets the globalization settings of the 
> application.
>     -->
>     <globalization
>             requestEncoding="utf-8"
>             responseEncoding="utf-8"
>    />
> 
>  </system.web>
> 
> </configuration>
> ----------
> 

Mime
View raw message