Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

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

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 12:54 PM
 

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 12:58 PM
 

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

Speed up your DNN Websites with TurboDNN
 
New Post
3/8/2007 4: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 2:19 PM
 

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 MVP, ASPInsider, DNN MVP
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 Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Log Application Shutdown reason...Log Application Shutdown reason...


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out