Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Active Modules -- Active Forums for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Chat About It!  Log Application Shutdown reason...
Previous Previous
 
Next Next
New Post 11/30/2006 8:37 AM
User is offline Frank Corrao
122 posts
www.raiseepilepsy.org
9th Ranked


Log Application Shutdown reason... 
Modified By Frank Corrao  on 11/30/2006 12:43:23 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 8:54 AM
User is offline Frank Corrao
122 posts
www.raiseepilepsy.org
9th Ranked


Re: Log Application Shutdown reason... 
Modified By Frank Corrao  on 11/30/2006 12:55:24 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 8:58 AM
User is offline Sebastian Leupold
13743 posts
www.deutschnetnuke.de
1st Ranked












Re: Log Application Shutdown reason... 

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


Sebastian Leupold

DeutschNetNuke dnnWerk - The DotNetNuke Experts German DotNetNuke User-Group

DotNetNuke Project UserDefinedTable
DotNetNuke Project Release Tracker
 
New Post 3/8/2007 12:26 AM
User is offline Hollywood
46 posts
10th Ranked


Re: Log Application Shutdown reason... 
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
User is offline Mitch Sellers
5372 posts
www.mitchelsellers.com
3rd Ranked




Re: Log Application Shutdown reason... 

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
MCITP, MCPD, MCTS
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 reccomend 3Essentials for shared hosting and BaseCamp for project management
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Chat About It!  Log Application Shutdown reason...
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Expressnet - DotNetNuke Hosting
Expressnet provide premium quality ASP.NET Web Hosting. We specialise in Windows based products including ASP.NET and Microsoft SQL Server. We offer fantastic value packages for DotNetNuke hosting. We also offer free asp.net web hosting
www.expressnet.com.au
Softech Development, Inc.
We help your business work smarter with DotNetNuke. Whether you need a new implementation, a custom module or skin for an existing implementation, or integration with your business processes, Softech has the experience and expertise to make it happen.
www.softechdevelopment.com
Module Development by Engage Software
Specializing in custom module development, training and skinning.
www.engagesoftware.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP