public ViewServerHost(IViewServerProtocol viewServerProtocol, IViewServerCommandHandlers viewServerCommandHandlers) { this.viewServerProtocol = viewServerProtocol; this.viewServerCommandHandlers = viewServerCommandHandlers; this.RegisterCommandHandler("reset", this.ResetHandler); this.RegisterCommandHandler("add_fun", this.AddFunHandler); this.RegisterCommandHandler("map_doc", this.MapDocHandler); this.RegisterCommandHandler("reduce", this.ReduceHandler); this.RegisterCommandHandler("rereduce", this.RereduceHandler); }
private static void InitNLog(IViewServerProtocol viewServerProtocol) { var config = new LoggingConfiguration(); var couchDbTarget = new LogTarget(viewServerProtocol); config.AddTarget("couchdb", couchDbTarget); var fileTarget = new FileTarget { FileName = "${basedir}/viewserver.log" }; config.AddTarget("file", fileTarget); config.LoggingRules.Add(new LoggingRule("*", LogLevel.Debug, fileTarget)); config.LoggingRules.Add(new LoggingRule("*", LogLevel.Info, couchDbTarget)); LogManager.Configuration = config; }
public LogTarget(IViewServerProtocol viewServerProtocol) { this.viewServerProtocol = viewServerProtocol; }