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/06/07 03:09:38 UTC

cvs commit: logging-log4net/src/Appender AdoNetAppender.cs RollingFileAppender.cs

nicko       2004/06/06 18:09:38

  Modified:    src/Appender AdoNetAppender.cs RollingFileAppender.cs
  Log:
  Made exception catching more specific
  
  Revision  Changes    Path
  1.6       +6 -2      logging-log4net/src/Appender/AdoNetAppender.cs
  
  Index: AdoNetAppender.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Appender/AdoNetAppender.cs,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AdoNetAppender.cs	30 May 2004 17:56:04 -0000	1.5
  +++ AdoNetAppender.cs	7 Jun 2004 01:09:38 -0000	1.6
  @@ -425,6 +425,7 @@
   							}
   							catch(Exception)
   							{
  +								// Ignore exception
   							}
   						}
   
  @@ -593,7 +594,7 @@
   		{
   			try
   			{
  -				return Type.GetType(m_connectionType, true);
  +				return SystemInfo.GetTypeFromString(m_connectionType, true, false);
   			}
   			catch(Exception ex)
   			{
  @@ -618,7 +619,7 @@
   				// Set the command type
   				m_dbCommand.CommandType = m_commandType;
   			}
  -			catch (System.Exception e)
  +			catch(System.Exception e)
   			{
   				ErrorHandler.Error("Could not create database command ["+m_commandText+"]", e);	 
   
  @@ -630,6 +631,7 @@
   					}
   					catch
   					{
  +						// Ignore exception
   					}
   					m_dbCommand = null;
   				}
  @@ -660,6 +662,7 @@
   					}
   					catch
   					{
  +						// Ignore exception
   					}
   					m_dbCommand = null;
   				}
  @@ -681,6 +684,7 @@
   					}
   					catch
   					{
  +						// Ignore exception
   					}
   					m_dbCommand = null;
   				}
  
  
  
  1.7       +3 -3      logging-log4net/src/Appender/RollingFileAppender.cs
  
  Index: RollingFileAppender.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Appender/RollingFileAppender.cs,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RollingFileAppender.cs	30 May 2004 18:01:18 -0000	1.6
  +++ RollingFileAppender.cs	7 Jun 2004 01:09:38 -0000	1.7
  @@ -583,7 +583,7 @@
   		/// Does the work of bumping the 'current' file counter higher
   		/// to the highest count when an incremental file name is seen.
   		/// The highest count is either the first file (when count direction
  -		/// is greater than 0 ) or the last file (when count direction less than 0).
  +		/// is greater than 0) or the last file (when count direction less than 0).
   		/// In either case, we want to know the highest count that is present.
   		/// </summary>
   		/// <param name="baseFile"></param>
  @@ -613,7 +613,7 @@
   				int endLength = curFileName.Length - index;
   				if (baseFile.Length + endLength != curFileName.Length) 
   				{
  -					//file is probably scheduledFilename + .x so I don't care
  +					// file is probably scheduledFilename + .x so I don't care
   					return;
   				}
   			}
  @@ -663,7 +663,7 @@
   					LogLog.Debug("RollingFileAppender: File name ["+curFileName+"] moves current count to ["+m_curSizeRollBackups+"]");
   				}
   			} 
  -			catch (Exception /*e*/) 
  +			catch (FormatException /*e*/) 
   			{
   				//this happens when file.log -> file.log.yyyy-mm-dd which is normal
   				//when staticLogFileName == false