I think the best place to initialize for static silo variables is in Silo Bootstrap .
Please note that Orleans is configured for the logger, and you can get it in grains by calling this.GetLogger() .
<edit> You can define a logger that inherits from ILogConsumer and add it to the collection of log receivers by calling Orleans.Runtime.TraceLogger.LogConsumers.Add() <./ Edit>
<edit 2015-07-16> :: This reappeared on the Orleans Gitter channel , where the following advice was offered from the main team member:
we publish in .NET Trace, and you can add new listeners to it. this is really the best way to do this without even touching Orleans.Runtime.TraceLogger.LogConsumers. just work with .NET TRace, with the usual tools and configuration. not related to Orleans. we just publish in Trace.
Added a new note to another Stackoverflow post, "Best Logging Practices," in which Sly Gryphon through the trace infrastructure is pretty comprehensive.
Veksi source share