HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Log Application Shutdown reason...Log Application Shutdown reason...
Previous
 
Next
New Post
11/30/2006 8:37 AM
 

All,

I'm not sure this belongs in this forum.  I'm a little confused on where I would post questions/changes to the CORE of dnn (i.e. not a module) so if someone wants to move this, GFI. 

I am having a frequent restarts on my 1and1 host and trying to get their tech support to answer a question like:

"What are your recycle settings for my app pool?" is just too darn frustrating.  Kinda funny though.  When I called their tech support, instead of the guy saying we didn't know what I was talking out, he said he found a bug and needed to change the code!!!  What code?  He's going to get into wp3.exe and change Microsoft's Application Pooling code?  I just hung up on him...  I really wish it wasn't such a pain to transfer a .org domain!

Anywho.. I came up with this code and put in the global.vb LogEnd() method.  Feel free to use.. I think they should include this in the next release also.  However, I am not a VB programmer (I'm a C# guy) and I'm not sure if VB has a switch statement so I took the lazy approach (if-then-elseif blah, blah, blah).  This even works with 1and1's very restrictive CAS policies.

Enjoy

Frank

 

''' -----------------------------------------------------------------------------

''' <summary>

''' LogEnd logs the Application Start Event

''' </summary>

''' <remarks>

''' </remarks>

''' <history>

''' [cnurse] 1/28/2005 Moved back to App_End from Logging Module

''' </history>

''' -----------------------------------------------------------------------------

Private Sub LogEnd()

Try

Dim objEv As New EventLogController

Dim objEventLogInfo As New LogInfo

objEventLogInfo.BypassBuffering = True

 

'FTC CHANGE 11/30/2006 - Added ShutDown Reason

Dim shutReason As System.Web.ApplicationShutdownReason = System.Web.Hosting.HostingEnvironment.ShutdownReason()

Dim shutMessage As String

If (shutReason = System.Web.ApplicationShutdownReason.BinDirChangeOrDirectoryRename) Then

shutMessage = "The AppDomain shut down because of a change to the Bin folder or files contained in it."

ElseIf (shutReason = System.Web.ApplicationShutdownReason.BrowsersDirChangeOrDirectoryRename) Then

shutMessage = "The AppDomain shut down because of a change to the App_Browsers folder or files contained in it."

ElseIf (shutReason = System.Web.ApplicationShutdownReason.ChangeInGlobalAsax) Then

shutMessage = "The AppDomain shut down because of a change to Global.asax."

ElseIf (shutReason = System.Web.ApplicationShutdownReason.ChangeInSecurityPolicyFile) Then

shutMessage = "The AppDomain shut down because of a change in the code access security policy file."

ElseIf (shutReason = System.Web.ApplicationShutdownReason.CodeDirChangeOrDirectoryRename) Then

shutMessage = "The AppDomain shut down because of a change to the App_Code folder or files contained in it."

ElseIf (shutReason = System.Web.ApplicationShutdownReason.ConfigurationChange) Then

shutMessage = "The AppDomain shut down because of a change to the application level configuration."

ElseIf (shutReason = System.Web.ApplicationShutdownReason.HostingEnvironment) Then

shutMessage = "The AppDomain shut down because of the hosting environment."

ElseIf (shutReason = System.Web.ApplicationShutdownReason.HttpRuntimeClose) Then

shutMessage = "The AppDomain shut down because of a call to Close."

ElseIf (shutReason = System.Web.ApplicationShutdownReason.IdleTimeout) Then

shutMessage = "The AppDomain shut down because of the maximum allowed idle time limit."

ElseIf (shutReason = System.Web.ApplicationShutdownReason.InitializationError) Then

shutMessage = "The AppDomain shut down because of an AppDomain initialization error."

ElseIf (shutReason = System.Web.ApplicationShutdownReason.MaxRecompilationsReached) Then

shutMessage = "The AppDomain shut down because of the maximum number of dynamic recompiles of resources limit."

ElseIf (shutReason = System.Web.ApplicationShutdownReason.PhysicalApplicationPathChanged) Then

shutMessage = "The AppDomain shut down because of a change to the physical path for the application."

ElseIf (shutReason = System.Web.ApplicationShutdownReason.ResourcesDirChangeOrDirectoryRename) Then

shutMessage = "The AppDomain shut down because of a change to the App_GlobalResources folder or files contained in it."

ElseIf (shutReason = System.Web.ApplicationShutdownReason.UnloadAppDomainCalled) Then

shutMessage = "The AppDomain shut down because of a call to UnloadAppDomain."

Else

shutMessage = "No shutdown reason provided."

End If

objEventLogInfo.AddProperty("ShutDownReason", shutMessage)

 

objEventLogInfo.LogTypeKey = Services.Log.EventLog.EventLogController.EventLogType.APPLICATION_SHUTTING_DOWN.ToString

objEv.AddLog(objEventLogInfo)

Catch exc As Exception

LogException(exc)

End Try

' purge log buffer

LoggingProvider.Instance.PurgeLogBuffer()

End Sub

 


Version: DNN 4.4.1
Hosting Provider: 1and1
RAISE
 
New Post
11/30/2006 8:54 AM
 

One other cool thing I found.. If you add this to the header of a module

<style type="text/css">

#marqueecontainer

{

position: relative;

/* width: 200px; marquee width */

height: 200px; /*marquee height */

background-color: white;

overflow: hidden;

padding: 2px;

padding-left: 4px;

}

</style>

<script type="text/javascript">

/***********************************************

* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)

* This notice MUST stay intact for legal use

* Visit http://www.dynamicdrive.com/ for this script and 100s more.

***********************************************/

var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)

var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)

var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed

var pausespeed=(pauseit==0)? copyspeed: 0

var actualheight=''

function scrollmarquee(){

if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))

cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"

else

cross_marquee.style.top=parseInt(marqueeheight)+8+"px"

}

function initializemarquee(){

cross_marquee=document.getElementById("vmarquee")

cross_marquee.style.top=0

marqueeheight=document.getElementById("marqueecontainer").offsetHeight

actualheight=cross_marquee.offsetHeight

if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit

cross_marquee.style.height=marqueeheight+"px"

cross_marquee.style.overflow="scroll"

return

}

setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)

}

if (window.addEventListener)

window.addEventListener("load", initializemarquee, false)

else if (window.attachEvent)

window.attachEvent("onload", initializemarquee)

else if (document.getElementById)

window.onload=initializemarquee

 

</script>

<div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 98%;">

 

 And this to the footer of a module

</div>
</div>

you get a scrolling module


Version: DNN 4.4.1
Hosting Provider: 1and1
RAISE
 
New Post
11/30/2006 8:58 AM
 

please post enhancement request into the public issue tracker at http://support.dotnetnuke.com


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group   European Network of DotNetNuke Professionals

 
New Post
3/8/2007 12:26 AM
 
This shutdown logging code is cool - thanks!

Please do add it to 4.5 - it would make my current host debugging problem so much easier....
 
New Post
3/8/2007 10:19 AM
 

Frankt,

That code you posted for the shutdown reasons is very helpful. 

Is it possible that I can port that over to C# an post it on my blog?  I will give credit to this post, I just have a need for something like this in each one of my hosted applications!


-Mitchel Sellers
Microsoft C# MVP, MCITP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Consulting Quotes, and DNN Technical Support Services

I recommend PowerDNN and 3Essentials for DotNetNuke Hosting and BaseCamp for project management
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Log Application Shutdown reason...Log Application Shutdown reason...