本文整理汇总了C#中Orleans.Runtime.Logger.Info方法的典型用法代码示例。如果您正苦于以下问题:C# Logger.Info方法的具体用法?C# Logger.Info怎么用?C# Logger.Info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orleans.Runtime.Logger
的用法示例。
在下文中一共展示了Logger.Info方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnActivateAsync
public override async Task OnActivateAsync()
{
logger = base.GetLogger("MultipleImplicitSubscriptionGrain " + base.IdentityString);
logger.Info("OnActivateAsync");
var streamProvider = GetStreamProvider("SMSProvider");
redStream = streamProvider.GetStream<int>(this.GetPrimaryKey(), "red");
blueStream = streamProvider.GetStream<int>(this.GetPrimaryKey(), "blue");
await redStream.SubscribeAsync(
(e, t) =>
{
logger.Info("Received a red event {0}", e);
redCounter++;
return TaskDone.Done;
});
await blueStream.SubscribeAsync(
(e, t) =>
{
logger.Info("Received a blue event {0}", e);
blueCounter++;
return TaskDone.Done;
});
}
示例2: Initialize_2
public Task Initialize_2(int ind)
{
index = ind;
logger = GetLogger("ConcurrentGrain-" + index);
logger.Info("Initialize(" + index + ")");
return TaskDone.Done;
}
示例3: OnActivateAsync
public override Task OnActivateAsync()
{
logger = base.GetLogger("StreamerOutGrain " + base.IdentityString);
logger.Info("OnActivateAsync");
numProducedItems = 0;
return TaskDone.Done;
}
开发者ID:OrleansContrib,项目名称:Orleans.StorageProviders.SimpleSQLServerStorage,代码行数:7,代码来源:StreamerOutGrain.cs
示例4: OnActivateAsync
public override Task OnActivateAsync()
{
Logger = GetLogger("BatchProducerGrain " + IdentityString);
Logger.Info("OnActivateAsync");
_numProducedItems = 0;
return TaskDone.Done;
}
示例5: AzureGossipTableTests
private AzureTableBasedGossipChannel gossipTable; // This type is internal
public AzureGossipTableTests()
{
logger = LogManager.GetLogger("AzureGossipTableTests", LoggerType.Application);
globalServiceId = Guid.NewGuid();
deploymentId = "test-" + globalServiceId;
IPAddress ip;
if (!IPAddress.TryParse("127.0.0.1", out ip))
{
logger.Error(-1, "Could not parse ip address");
return;
}
IPEndPoint ep1 = new IPEndPoint(ip, 21111);
siloAddress1 = SiloAddress.New(ep1, 0);
IPEndPoint ep2 = new IPEndPoint(ip, 21112);
siloAddress2 = SiloAddress.New(ep2, 0);
logger.Info("DeploymentId={0}", deploymentId);
GlobalConfiguration config = new GlobalConfiguration
{
ServiceId = globalServiceId,
ClusterId = "0",
DeploymentId = deploymentId,
DataConnectionString = TestDefaultConfiguration.DataConnectionString
};
gossipTable = new AzureTableBasedGossipChannel();
var done = gossipTable.Initialize(config.ServiceId, config.DataConnectionString);
if (!done.Wait(timeout))
{
throw new TimeoutException("Could not create/read table.");
}
}
示例6: OnActivateAsync
public override Task OnActivateAsync()
{
activationGuid = Guid.NewGuid();
logger = GetLogger(String.Format("{0}", activationGuid));
logger.Info("Activate.");
return TaskDone.Done;
}
示例7: Init
/// <summary>
/// Initialize current instance with specific global configuration and logger
/// </summary>
/// <param name="config"> Global configuration to initialize with </param>
/// <param name="logger"> Specific logger to use in current instance </param>
/// <returns></returns>
public Task Init(GlobalConfiguration config, Logger logger)
{
deploymentId = config.DeploymentId;
serviceId = config.ServiceId;
this.logger = logger;
storage = new DynamoDBStorage(config.DataConnectionStringForReminders, logger);
logger.Info(ErrorCode.ReminderServiceBase, "Initializing AWS DynamoDB Reminders Table");
var secondaryIndex = new GlobalSecondaryIndex
{
IndexName = SERVICE_ID_INDEX,
Projection = new Projection { ProjectionType = ProjectionType.ALL },
KeySchema = new List<KeySchemaElement>
{
new KeySchemaElement { AttributeName = SERVICE_ID_PROPERTY_NAME, KeyType = KeyType.HASH},
new KeySchemaElement { AttributeName = GRAIN_HASH_PROPERTY_NAME, KeyType = KeyType.RANGE }
}
};
return storage.InitializeTable(TABLE_NAME_DEFAULT_VALUE,
new List<KeySchemaElement>
{
new KeySchemaElement { AttributeName = REMINDER_ID_PROPERTY_NAME, KeyType = KeyType.HASH },
new KeySchemaElement { AttributeName = GRAIN_HASH_PROPERTY_NAME, KeyType = KeyType.RANGE }
},
new List<AttributeDefinition>
{
new AttributeDefinition { AttributeName = REMINDER_ID_PROPERTY_NAME, AttributeType = ScalarAttributeType.S },
new AttributeDefinition { AttributeName = GRAIN_HASH_PROPERTY_NAME, AttributeType = ScalarAttributeType.N },
new AttributeDefinition { AttributeName = SERVICE_ID_PROPERTY_NAME, AttributeType = ScalarAttributeType.S }
},
new List<GlobalSecondaryIndex> { secondaryIndex });
}
示例8: PersistentStreamPullingAgent
internal PersistentStreamPullingAgent(
GrainId id,
string strProviderName,
IStreamProviderRuntime runtime,
IStreamPubSub streamPubSub,
QueueId queueId,
PersistentStreamProviderConfig config)
: base(id, runtime.ExecutingSiloAddress, true)
{
if (runtime == null) throw new ArgumentNullException("runtime", "PersistentStreamPullingAgent: runtime reference should not be null");
if (strProviderName == null) throw new ArgumentNullException("runtime", "PersistentStreamPullingAgent: strProviderName should not be null");
QueueId = queueId;
streamProviderName = strProviderName;
providerRuntime = runtime;
pubSub = streamPubSub;
pubSubCache = new Dictionary<StreamId, StreamConsumerCollection>();
safeRandom = new SafeRandom();
this.config = config;
numMessages = 0;
logger = providerRuntime.GetLogger(GrainId + "-" + streamProviderName);
logger.Info((int)ErrorCode.PersistentStreamPullingAgent_01,
"Created {0} {1} for Stream Provider {2} on silo {3} for Queue {4}.",
GetType().Name, GrainId.ToDetailedString(), streamProviderName, Silo, QueueId.ToStringWithHashCode());
string statUniquePostfix = strProviderName + "." + QueueId;
numReadMessagesCounter = CounterStatistic.FindOrCreate(new StatisticName(StatisticNames.STREAMS_PERSISTENT_STREAM_NUM_READ_MESSAGES, statUniquePostfix));
numSentMessagesCounter = CounterStatistic.FindOrCreate(new StatisticName(StatisticNames.STREAMS_PERSISTENT_STREAM_NUM_SENT_MESSAGES, statUniquePostfix));
IntValueStatistic.FindOrCreate(new StatisticName(StatisticNames.STREAMS_PERSISTENT_STREAM_PUBSUB_CACHE_SIZE, statUniquePostfix), () => pubSubCache.Count);
// TODO: move queue cache size statistics tracking into queue cache implementation once Telemetry APIs and LogStatistics have been reconciled.
//IntValueStatistic.FindOrCreate(new StatisticName(StatisticNames.STREAMS_PERSISTENT_STREAM_QUEUE_CACHE_SIZE, statUniquePostfix), () => queueCache != null ? queueCache.Size : 0);
}
示例9: OnActivateAsync
public override async Task OnActivateAsync()
{
await base.OnActivateAsync();
string id = this.GetPrimaryKeyLong().ToString();
logger = GetLogger(String.Format("{0}-{1}", GetType().Name, id));
logger.Info("Activate.");
}
示例10: OnDeactivateAsync
public override async Task OnDeactivateAsync()
{
_logger = GetLogger("ProducerEventCountingGrain " + IdentityString);
_logger.Info("Producer.OnDeactivateAsync");
_numProducedItems = 0;
await base.OnDeactivateAsync();
}
示例11: OnActivateAsync
public override Task OnActivateAsync()
{
logger = base.GetLogger("GeneratedEventReporterGrain " + base.IdentityString);
logger.Info("OnActivateAsync");
reports = new Dictionary<Tuple<string, string>, Dictionary<Guid, int>>();
return base.OnActivateAsync();
}
示例12: OnActivateAsync
public override Task OnActivateAsync()
{
EventDelay = 1000;
Observers = new ObserverSubscriptionManager<ISimpleGrainObserver>();
logger = GetLogger(String.Format("{0}-{1}-{2}", typeof(SimpleObserverableGrain).Name, base.IdentityString, base.RuntimeIdentity));
logger.Info("Activate.");
return TaskDone.Done;
}
示例13: OnActivateAsync
public override Task OnActivateAsync()
{
grainStore = new Dictionary<string, GrainStateStore>();
base.DelayDeactivation(TimeSpan.FromDays(10 * 365)); // Delay Deactivation for MemoryStorageGrain virtually indefinitely.
logger = GetLogger(GetType().Name);
logger.Info("OnActivateAsync");
return TaskDone.Done;
}
示例14: OnActivateAsync
public override Task OnActivateAsync()
{
logger = GetLogger(String.Format("CollectionTestGrain {0} {1} on {2}.", Identity, Data.ActivationId, RuntimeIdentity));
logger.Info("OnActivateAsync.");
activated = DateTime.UtcNow;
counter = 0;
return TaskDone.Done;
}
示例15: LogStartTest
internal static void LogStartTest(string testName, Guid streamId, string streamProviderName, Logger logger, TestingSiloHost siloHost)
{
SiloAddress primSilo = siloHost.Primary.Silo.SiloAddress;
SiloAddress secSilo = siloHost.Secondary?.Silo.SiloAddress;
logger.Info("\n\n**START********************** {0} ********************************* \n\n"
+ "Running with initial silos Primary={1} Secondary={2} StreamId={3} StreamType={4} \n\n",
testName, primSilo, secSilo, streamId, streamProviderName);
}