Share via


ApplicationPoolRecycling.LogEventOnRecycle Property

Definition

Gets or sets the logging behavior of a recycling application pool.

public:
 property Microsoft::Web::Administration::RecyclingLogEventOnRecycle LogEventOnRecycle { Microsoft::Web::Administration::RecyclingLogEventOnRecycle get(); void set(Microsoft::Web::Administration::RecyclingLogEventOnRecycle value); };
public Microsoft.Web.Administration.RecyclingLogEventOnRecycle LogEventOnRecycle { get; set; }
member this.LogEventOnRecycle : Microsoft.Web.Administration.RecyclingLogEventOnRecycle with get, set
Public Property LogEventOnRecycle As RecyclingLogEventOnRecycle

Property Value

One or more of the RecyclingLogEventOnRecycle values. The defaults are Time, Memory, and PrivateMemory.

Examples

The following example displays the value of the LogEventOnRecycle property and then sets the property to a value of 6 (Requests and Schedule). This code example is part of a larger example provided for the ApplicationPoolRecycling class.

Console.WriteLine("LogEventOnRecycle:\t{0}",
    manager.ApplicationPools["DefaultAppPool"].Recycling.LogEventOnRecycle.ToString());
// Change the LogEventOnRecycle and PeriodicRestart.Time properties.
manager.ApplicationPools["DefaultAppPool"].Recycling.LogEventOnRecycle = (RecyclingLogEventOnRecycle)6;
manager.ApplicationPools["DefaultAppPool"].Recycling.PeriodicRestart.Time = TimeSpan.FromMinutes(5);
// Commit the changes to ApplicationHost.config file.
manager.CommitChanges();

Remarks

This property specifies that IIS should log an event when an application pool is recycled for one or more of the reasons defined in the <xref:System.ApplicationHost.Configuration.RecyclingLogEventOnRecycle?displayProperty=fullName> enumeration.

For IIS to log the event, the LogEventOnRecycle property must have a bit set that corresponds to the reason for the recycle operation.

Applies to