[ 
https://issues.apache.org/jira/browse/LOG4NET-178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13127660#comment-13127660
 ] 

Roy Chastain commented on LOG4NET-178:
--------------------------------------

Stefan, I have no idea.  I never tried it the other way.

Matthew, I do not even have the global appstart and append methods in my code.  
I have a IIS hosted web service (.svc).  In the constructor for the class that 
implments the service, I make reference to a singleton class that holds a lot 
of redundant and static data.  The singleton class constructor calls the 
log4Net configure as its first operation.  I create a static logger for each 
class that I have logging in.  I have wrapper code that can determine the 
object instansation of the class so that each instansation of the class is 
displayed differently in the log.

An interesting, but not extermely suprising, note is that even though I create 
the logger for the service implementation class before configuration log4Net, 
it still works and logs entries correctly for the first creation of the service 
class.

BTW.  I do NOT call the log4Net "shutdown" method.  I have used log4Net in 
about 20 self-hosted services and several desktop applications and now one IIS 
hosted service, and I have never called that method.  I have not looked at the 
code to see what it does and why I would call it, but I cannot say that I have 
seen a down side to not calling it.
                
> Log4Net stops logging after appdomain recycle of aps.net2.0 application
> -----------------------------------------------------------------------
>
>                 Key: LOG4NET-178
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-178
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: Windows server 2003
>            Reporter: Richard Nijkamp
>             Fix For: 1.2 Maintenance Release
>
>
> Dear sir/madam,
>  We are using Log4Net 1.2.10. We encounter the problem that Log4net doesn't 
> continue logging after an event that triggers an appdomain recycle/restart.
>  In the global.asax we start the logging with:
>  private static readonly ILog log = 
> LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
> Logging works flawless when the application is started for the first time. 
> After sometime it might occur that the appdomain gets recycled due to 
> inactivity of the web application. We use the following code in 
> Application_end():
> log.Info("*** Application end ***");
> log4net.LogManager.Shutdown();
> After this function the application gets restarted and the 
> Application_start() method executes and writes new lines to the log. The 
> problem is that the log4net doesn't write the new lines after the restart. 
> Could you explain why log4net might stop working after an appdomain restart 
> of an asp.net2.0 web application? If I want log4net to work properly again I 
> need to restart IIS manually.
>  Looking forward to your reply.
> Best regards,
> Richard Nijkamp

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to