Example #1
0
        /// <summary>
		/// This property initializes the logger.
		/// </summary>
		/// <param name="settings">The logger settings</param>
		/// <exception cref="System.ArgumentNullException">The settings parameter cannot be null.</exception>
        public virtual void Initialize(IXimuraLoggerSettings settings)
		{
			if (settings == null)
				throw new ArgumentNullException("settings","The logger settings cannot be null.");

			this.mSettings=settings;

			try
			{
                mLoglevel = mSettings.LogLevel;
			}
			catch
			{
				mLoglevel = 0;
			}
		
			try 
			{
                Name = mSettings.LoggerID;
			}
			catch
			{
				Name = "";
			}
		}
Example #2
0
        /// <summary>
        /// This method initializes the logger.
        /// </summary>
        /// <param name="ApplicationDefinition">The application definition.</param>
        /// <param name="settings">The logger settings.</param>
        public override void Initialize(IXimuraLoggerSettings settings)
        {
            base.Initialize(settings);

#if (DEBUG)
            bool exists = false;

            try
            {
                exists = EventLog.SourceExists(settings.LoggerID);
            }
            catch (Exception ex)
            {}

            if (!exists)
            {
                //An event log source should not be created and immediately used.
                //There is a latency time to enable the source, it should be created
                //prior to executing the application that uses the source.
                //Execute this sample a second time to use the new source.

                //EventSourceCreationData data = new EventSourceCreationData();
                //data.
                EventLog.CreateEventSource(settings.LoggerID, settings.LoggerName);
            }
#endif

            mSource = settings.LoggerID;
        }
Example #3
0
        public override void Initialize(IXimuraLoggerSettings settings)
        {
            base.Initialize(settings);

            path = settings.GetSetting("filepath");
            dbConn = settings.GetSetting("dbconnection");

            canWriteDB = dbConn != null && dbConn != "";
            canWriteFile = path != null && path != "";
        }
Example #4
0
		/// <summary>
		/// This method is used for initialization. For the null logger this
		/// does not do anything.
		/// </summary>
		/// <param name="settings"></param>
		public override void Initialize(IXimuraLoggerSettings settings)
		{
			// Do nothing
		}