Ejemplo n.º 1
0
        public CadOperationBehavior()
        {
            DBManagerBase dbm = new DBManagerBase(OriginType.CAD, (EnvironmentType)Enum.Parse(typeof(EnvironmentType), ConfigurationManager.AppSettings.Get("Env")));

            CadServiceLogFileName            = dbm.CadServiceLogFileName;
            CadServiceLogDirectoryName       = dbm.CadServiceLogDirectoryName;
            CadServiceLogHttpMessageFileName = dbm.CadServiceLogHttpMessageFileName;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RollingXmlWriterTraceListener"/> class by specifying the trace file
 /// name.
 /// </summary>
 /// <param name="filename">The trace file name.</param>
 public RollingXmlWriterTraceListener(string filename)
     : base(new ImpersonationHelper((OriginType)Enum.Parse(typeof(OriginType), filename.Split(',')[1].ToString().Trim()), (EnvironmentType)Enum.Parse(typeof(EnvironmentType), ConfigurationManager.AppSettings.Get("Env"))).loadFileName(System.Environment.MachineName + "_" + filename.Split(',')[0].ToString().Trim()))
 {
     //Handle unhandled exceptions
     AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
     //Set envionment variables
     this.dbManagerBase = new DBManagerBase((OriginType)Enum.Parse(typeof(OriginType), filename.Split(',')[1].ToString().Trim()), (EnvironmentType)Enum.Parse(typeof(EnvironmentType), ConfigurationManager.AppSettings.Get("Env")));
     //Set the base directory/file name
     this.basicTraceFileName = dbManagerBase.ServiceLogDirectoryName + System.Environment.MachineName + "_" + filename.Split(',')[0].ToString().Trim();
     //Get the newest file - because it could have been created by another thread
     this.currentFileSuffixNumber = this.GetTraceFileNumber();
     this.StartNewTraceFile();
 }