Inheritance: Microsoft.WindowsAzure.Storage.Table.TableEntity
コード例 #1
0
        /// <summary>
        /// Add an entry to the Azure Storage table.
        /// Check if the connection has been initialized properly (_cloudTable is not null).
        /// </summary>
        /// <param name="entity"></param>
        public void Add(LogEntity entity)
        {
            // check if this connection has been initialized. if it hasn't, it is likely because
            // we were unable to connect, or the config is invalid, or the "development storage" is used
            // on the production server
            if (_cloudTable == null)
            {
                Trace.TraceWarning("NLog.Extensions.AzureTableStorage logging was attempted but the target is not initialized.");
                Trace.TraceWarning("You will not capture any NLog messages until the target initializes successfully.");
                Trace.TraceWarning("This could be due to a missing connection string or an error during the target initialization.");
                Trace.TraceWarning("Please check the log for previous error messages!");

                return;
            }

            var insertOperation = TableOperation.Insert(entity);

            _cloudTable.ExecuteAsync(insertOperation);
        }
コード例 #2
0
        public void Add(LogEntity entity)
        {
            var insertOperation = TableOperation.Insert(entity);

            _cloudTable.Execute(insertOperation);
        }
        /// <summary>
        /// Add an entry to the Azure Storage table.
        /// Check if the connection has been initialized properly (_cloudTable is not null).
        /// </summary>
        /// <param name="entity"></param>
        public void Add(LogEntity entity)
        {
            // check if this connection has been initialized. if it hasn't, it is likely because
            // we were unable to connect, or the config is invalid, or the "development storage" is used 
            // on the production server
            if (_cloudTable == null)
            {
                Trace.TraceWarning("NLog.Extensions.AzureTableStorage logging was attempted but the target is not initialized.");
                Trace.TraceWarning("You will not capture any NLog messages until the target initializes successfully.");
                Trace.TraceWarning("This could be due to a missing connection string or an error during the target initialization.");
                Trace.TraceWarning("Please check the log for previous error messages!");

                return;
            }

            var insertOperation = TableOperation.Insert(entity);
            _cloudTable.Execute(insertOperation);
        }
コード例 #4
0
 public void Add(LogEntity entity)
 {
     var insertOperation = TableOperation.Insert(entity);
     _cloudTable.Execute(insertOperation);
 }