logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominik Psenner" <dpsen...@gmail.com>
Subject AW: 404 reguests logs as 500 errors
Date Tue, 25 Feb 2014 08:07:19 GMT
Hey there

This does not look like a 500 (internal server error) to me. There it
states:

System.Web.HttpException (0x80004005): Not Found.

Of course if you're requesting something within the clients web request, a
404 in the servers request could cause a subsequent 500 on the client
because the server obviously failed to fulfil an apparently valid request.
This behaviour is to be expected and if you want to change that behaviour
you probably have to fix your code. There is nothing that the logging
framework could do.

Best regards
Dominik

>-----Urspr√ľngliche Nachricht-----
>Von: hesta96 [mailto:hesta96@hotmail.com]
>Gesendet: Dienstag, 25. Februar 2014 08:49
>An: log4net-dev@logging.apache.org
>Betreff: 404 reguests logs as 500 errors
>
>We are using log4net to log our site and it is working great but there is
one
>thing we are not able to solve and that is that many 404 request also logs
>as a 500 error.
>---------------------------------------------------------------------------
--------------------
>-------
>For example the request for a image as this address (that does not exist):
>http://www.lernia.se/Global/Imagebilder/Toppbilder%20utbildningssida%20(
>produktblad%20mm)%20460x283/5778.jpg
>Gives a 404 return from the server but also this error in the errorlog:
>1.2.5 Unhandled exception in ASP.NET
>
>System.Web.HttpException (0x80004005): Not Found.
>   at EPiServer.Web.StaticFileHandler.ProcessRequest(HttpContext context)
>   at
>System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApp
>lication.IExecutionStep.Execute()
>   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
>completedSynchronously)
>
>---------------------------------------------------------------------------
--------------------
>-------
>Another example is the request for a aspx-page that does not exist:
>http://www.lernia.se/Pages/GoogleMapPage.aspx?LatLong=59.333124,18.06
>4613
>Gives a 404 return but logs this in the errorlog
>1.2.5 Unhandled exception in ASP.NET
>
>System.Web.HttpException (0x80004005): The file
>'/Pages/GoogleMapPage.aspx'
>does not exist.
>   at
>System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(Virtual
>Path
>virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean
>allowBuildInPrecompile, Boolean throwIfNotFound, Boolean
>ensureIsUpToDate)
>   at
>System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(H
>ttpContext
>context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp,
>Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean
>ensureIsUpToDate)
>   at
>System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(Virtual
>Path
>virtualPath, HttpContext context, Boolean allowCrossApp, Boolean
>throwIfNotFound)
>   at
>System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(Virtu
>alPath
>virtualPath, Type requiredBaseType, HttpContext context, Boolean
>allowCrossApp)
>   at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext
>context,
>String requestType, VirtualPath virtualPath, String physicalPath)
>   at
>System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.
>HttpApplication.IExecutionStep.Execute()
>   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
>completedSynchronously)
>---------------------------------------------------------------------------
--------------------
>-------
>
>The config we are using looks like this:
><?xml version="1.0" encoding="utf-8"?>
><log4net>
>
>
>  <appender name="RollingFile"
>type="log4net.Appender.RollingFileAppender">
>    <file value="D:\Logs\Errors.log" />
>    <encoding value="utf-8" />
>    <staticLogFileName value="true"/>
>    <datePattern value=".yyyyMMdd.'log'" />
>    <rollingStyle value="Date" />
>    <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
>    <appendToFile value="true" />
>    <maximumFileSize value="5000KB" />
>    <maxSizeRollBackups value="10" />
>    <layout type="log4net.Layout.PatternLayout">
>      <conversionPattern value="%date [%thread] %-5level %identity
>%property{log4net:HostName} %type.%method:
>%message%newline%exception" />
>    </layout>
>  </appender>
>  <appender name="EpiRollingFile"
>type="log4net.Appender.RollingFileAppender">
>    <file value="D:\Logs\EPiserverErrors.log" />
>    <encoding value="utf-8" />
>    <staticLogFileName value="true"/>
>    <datePattern value=".yyyyMMdd.'log'" />
>    <rollingStyle value="Date" />
>    <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
>    <appendToFile value="true" />
>    <maximumFileSize value="5000KB" />
>    <maxSizeRollBackups value="10" />
>    <layout type="log4net.Layout.PatternLayout">
>      <conversionPattern value="%date [%thread] %-5level %identity
>%property{log4net:HostName} %type.%method:
>%message%newline%exception" />
>    </layout>
>  </appender>
>
>  <logger name="ActiveSolution" additivity="false">
>    <level value="INFO" />
>    <appender-ref ref="RollingFile" />
>  </logger>
>  <logger name="LerniaSE.Web.Pages.WebbCV" additivity="false">
>    <level value="ERROR" />
>    <appender-ref ref="RollingFile" />
>  </logger>
>
>  <logger name="EPiServer" additivity="false">
>    <level value="ERROR" />
>    <appender-ref ref="EpiRollingFile" />
>  </logger>
>  <logger name="EPiServer.Core.OptimisticCache" additivity="false">
>    <level value="ERROR" />
>  </logger>
>  <logger name="EPiServer.Core.ContentProvider" additivity="false">
>    <level value="ERROR" />
>  </logger>
>  <logger name="EPiServer.Data.Dynamic.Providers.DbDataStoreProvider"
>additivity="false">
>    <level value="ERROR" />
>  </logger>
>  <logger name="EPiServer.Data.Providers.SqlDatabaseHandler"
>additivity="false">
>    <level value="ERROR" />
>  </logger>
>  <logger name="EPiServer.Data.Providers.ConnectionContext"
>additivity="false">
>    <level value="ERROR" />
>  </logger>
>
>  <logger name="NHibernate" additivity="false">
>    <level value="ERROR" />
>  </logger>
>
>  <root>
>    <level value="ERROR" />
>    <appender-ref ref="RollingFile" />
>  </root>
></log4net>
>
>I hope someone has any clue how to get these 404 pages not to report as a
>500-error since it filling up our logfiles and hiding the real errors.
>
>Sincerely
>
>Henrik Fransas
>
>
>
>
>
>--
>View this message in context: http://apache-
>logging.6191.n7.nabble.com/404-reguests-logs-as-500-errors-tp44797.html
>Sent from the Log4net - Dev mailing list archive at Nabble.com.


Mime
View raw message