dependabot-preview[bot] on nuget
dependabot-preview[bot] on dev
Bump MongoDB.Driver from 2.9.1 … (compare)
@DamianReeves in Akka (and other message based models) it's easier to define a contract on message level, i.e:
interface IMyProtocolMessage {}
sealed class MyMessage1 : IMyProtocolMessage {}
sealed class MyMessage2 : IMyProtocolMessage {}
Unlike method calls, messages are composable. You can wrap one message with another, batch them, redirect or persist if necessary. Also, you can define dynamic interfaces (through Become) with that.
For type safety it's possible to wrap IActorRef
s with typed version (think IActorRef<IMyProtocolMessage>
) - I've made this a default in Akkling.
loggers = ["Akka.Logger.NLog.NLogLogger, Akka.Logger.NLog"]
with proper (i think) nlog entries but i still get buslogger as the default logger. How can i debug what config is used for system creation and what logger is picked?
var section = (AkkaConfigurationSection)ConfigurationManager.GetSection("akka");
var system = ActorSystem.Create("webcrawler2");
ClusterSystem = ActorSystem.Create("webcrawler", section.AkkaConfig);
@Horusiath this is from my config file. Akka: <akka>
<hocon>
<![CDATA[
akka {
loglevel = DEBUG
loggers = ["Akka.Logger.NLog.NLogLogger, Akka.Logger.NLog"]
log-config-on-start = on
}
]]>
</hocon>
</akka>
And configsections deifinition
<section name="akka" type="Akka.Configuration.Hocon.AkkaConfigurationSection, Akka" />
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
And nlog section
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autoReload="true" throwExceptions="true"
internalLogFile="C:\Temp\internal_log_file.txt" debug="true" internalLogLevel="Trace">
<targets>
<target name="f1" xsi:type="File" fileName="Scrapper.logfile" layout="[${date}] [${threadid}] [${message}]" />
<target name="c" xsi:type="Console" layout="[${threadid}] [${message}]" />
</targets>
<rules>
<logger name="*" writeTo="f1" />
<logger name="*" writeTo="c" minlevel="DEBUG" />
</rules>
</nlog>
tried to create actiorsystem in following waysvar section = (AkkaConfigurationSection)ConfigurationManager.GetSection("akka");
var system = ActorSystem.Create("webcrawler2");
ClusterSystem = ActorSystem.Create("webcrawler", section.AkkaConfig);
As i see, first version is basically what is done is original source code
private readonly ILoggingAdapter _logger = Context.GetLogger();
public class Program
{
public static void Main(string[] args)
{
// Ensure NLog logs errors even if config file can't be parsed
InternalLogger.LogLevel = LogLevel.Error;
InternalLogger.LogToConsoleError = true;
InternalLogger.LogToTrace = true;
InternalLogger.LogFile = "nlog.errors";
// Initialize topshelf service
HostFactory.Run(x =>
{
x.SetServiceName("MyService");
x.SetDisplayName("My Service");
x.UseNLog();
x.StartAutomaticallyDelayed();
x.Service<MyService>();
});
}
}