You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by ni...@apache.org on 2004/08/20 00:28:33 UTC

cvs commit: logging-log4net/src/Core LoggingEvent.cs

nicko       2004/08/19 15:28:33

  Modified:    src/Core LoggingEvent.cs
  Log:
  Changed to use SystemInfo.ProcessStartTime property. Updated doc comments
  
  Revision  Changes    Path
  1.8       +32 -20    logging-log4net/src/Core/LoggingEvent.cs
  
  Index: LoggingEvent.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Core/LoggingEvent.cs,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- LoggingEvent.cs	30 Jul 2004 17:42:35 -0000	1.7
  +++ LoggingEvent.cs	19 Aug 2004 22:28:33 -0000	1.8
  @@ -72,6 +72,11 @@
   		/// <summary>
   		/// The time the event was logged
   		/// </summary>
  +		/// <remarks>
  +		/// <para>
  +		/// The TimeStamp is stored in the local time zone for this computer.
  +		/// </para>
  +		/// </remarks>
   		public DateTime TimeStamp;
   
   		/// <summary>
  @@ -273,6 +278,8 @@
   
   			m_data.LoggerName = loggerName;
   			m_data.Level = level;
  +
  +			// Store the event creation time
   			m_data.TimeStamp = DateTime.Now;
   
   			// Lookup the global properties as soon as possible
  @@ -367,16 +374,29 @@
   		#region Public Instance Properties
   	
   		/// <summary>
  -		/// Gets the time when the application started, in milliseconds elapsed 
  -		/// since 01.01.1970.
  +		/// Gets the time when the current process started.
   		/// </summary>
   		/// <value>
  -		/// The time when the application started, in milliseconds elapsed 
  -		/// since 01.01.1970.
  +		/// This is the time when this process started.
   		/// </value>
  +		/// <remarks>
  +		/// <para>
  +		/// The TimeStamp is stored in the local time zone for this computer.
  +		/// </para>
  +		/// <para>
  +		/// Tries to get the start time for the current process.
  +		/// Failing that it returns the time of the first call to
  +		/// this property.
  +		/// </para>
  +		/// <para>
  +		/// Note that AppDomains may be loaded and unloaded within the
  +		/// same process without the process terminating and therefore
  +		/// without the process start time being reset.
  +		/// </para>
  +		/// </remarks>
   		public static DateTime StartTime
   		{
  -			get { return s_startTime; }
  +			get { return SystemInfo.ProcessStartTime; }
   		}
   
   		/// <summary>
  @@ -396,6 +416,11 @@
   		/// <value>
   		/// The time of the logging event.
   		/// </value>
  +		/// <remarks>
  +		/// <para>
  +		/// The TimeStamp is stored in the local time zone for this computer.
  +		/// </para>
  +		/// </remarks>
   		public DateTime TimeStamp
   		{
   			get { return m_data.TimeStamp; }
  @@ -831,7 +856,7 @@
   		/// Gets the global properties defined when this event was created.
   		/// </summary>
   		/// <value>
  -		/// Globally diefined properties.
  +		/// Globally defined properties.
   		/// </value>
   		/// <remarks>
   		/// Global properties are defined by the <see cref="GlobalContext"/>
  @@ -841,7 +866,7 @@
   			get 
   			{ 
   				// The global properties are captured in the constructor
  -				// because they are global shareed state they must be captured as soon as possible
  +				// because they are global shared state they must be captured as soon as possible
   
   				if (m_data.GlobalProperties == null)
   				{
  @@ -1197,19 +1222,6 @@
   		}
   
   		#endregion Public Instance Methods
  -
  -		#region Private Static Fields
  -
  -		/// <summary>
  -		/// Stores the time when this class is loaded.
  -		/// </summary>
  -		/// <remarks>
  -		/// This is used to provide times relative to the
  -		/// application start.
  -		/// </remarks>
  -		private static readonly DateTime s_startTime = DateTime.Now;
  -
  -		#endregion Private Static Fields
   
   		#region Private Instance Fields