2

There is a weird behavior while using Akka.Event.Logging logger. This seems to spit out the same log message twice while using either WARN or ERROR log level but not in INFO and DEBUG. Not sure if this is a bug or I am missing something. Following is an example code and screen shot of the message:

public class ImagePersistanceActor : ReceiveActor, ILogReceive
{
    LoggingAdapter log = Logging.GetLogger(Context);

    public ImagePersistanceActor()
    {
        Receive<string>(message =>
        {
            Console.WriteLine("Echo from Recieve actor: " + message);
        });

        Receive<Object>(unhandledMsg => {
            log.Warn("Unhandled message : " + unhandledMsg + " | Received at: " + DateTime.Now.Ticks);
            Console.WriteLine(unhandledMsg);
        });
    }
}

void main(){
       var receiveActor = system.ActorOf<ImagePersistanceActor>("receiveActor");
       receiveActor.Tell("Hello world");
       receiveActor.Tell(12233); //unhandled message
}

Output console screenshot attached here: http://i.stack.imgur.com/3ReqJ.jpg

4

0 回答 0