public override void ExecuteCommand(ClientManager clientManager, Alachisoft.NCache.Common.Protobuf.Command command) { ///Command: /// GETLOGGINGINFO "requestId" /// string requestId = string.Empty; Alachisoft.NCache.Common.Protobuf.GetLoggingInfoCommand getLoggingInfoCommand = command.getLoggingInfoCommand; requestId = getLoggingInfoCommand.requestId.ToString(); bool errorEnabled = ConnectionManager.GetClientLoggingInfo(LoggingInfo.LoggingType.Error) == LoggingInfo.LogsStatus.Enable; bool detailedEnabled = ConnectionManager.GetClientLoggingInfo(LoggingInfo.LoggingType.Detailed) == LoggingInfo.LogsStatus.Enable; if (!errorEnabled) detailedEnabled = false; try { Alachisoft.NCache.Common.Protobuf.Response response = new Alachisoft.NCache.Common.Protobuf.Response(); Alachisoft.NCache.Common.Protobuf.GetLoggingInfoResponse loggingInfoResponse = new Alachisoft.NCache.Common.Protobuf.GetLoggingInfoResponse(); response.requestId = command.requestID; loggingInfoResponse.errorsEnabled = errorEnabled; loggingInfoResponse.detailedErrorsEnabled = detailedEnabled; response.getLoggingInfoResponse = loggingInfoResponse; response.responseType = Alachisoft.NCache.Common.Protobuf.Response.Type.GET_LOGGING_INFO; _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeResponse(response)); } catch (Exception exc) { _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeExceptionResponse(exc, command.requestID)); } }
public override void ExecuteCommand(ClientManager clientManager, Alachisoft.NCache.Common.Protobuf.Command command) { string requestId = string.Empty; Alachisoft.NCache.Common.Protobuf.GetLoggingInfoCommand getLoggingInfoCommand = command.getLoggingInfoCommand; requestId = getLoggingInfoCommand.requestId.ToString(); bool errorEnabled = ConnectionManager.GetClientLoggingInfo(LoggingInfo.LoggingType.Error) == LoggingInfo.LogsStatus.Enable; bool detailedEnabled = ConnectionManager.GetClientLoggingInfo(LoggingInfo.LoggingType.Detailed) == LoggingInfo.LogsStatus.Enable; if (!errorEnabled) { detailedEnabled = false; } try { Alachisoft.NCache.Common.Protobuf.Response response = new Alachisoft.NCache.Common.Protobuf.Response(); Alachisoft.NCache.Common.Protobuf.GetLoggingInfoResponse loggingInfoResponse = new Alachisoft.NCache.Common.Protobuf.GetLoggingInfoResponse(); response.requestId = command.requestID; response.commandID = command.commandID; loggingInfoResponse.errorsEnabled = errorEnabled; loggingInfoResponse.detailedErrorsEnabled = detailedEnabled; response.getLoggingInfoResponse = loggingInfoResponse; response.responseType = Alachisoft.NCache.Common.Protobuf.Response.Type.GET_LOGGING_INFO; _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeResponse(response)); } catch (Exception exc) { _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeExceptionResponse(exc, command.requestID, command.commandID)); } }
public override void ExecuteCommand(ClientManager clientManager, Alachisoft.NCache.Common.Protobuf.Command command) { ///Command: /// GETLOGGINGINFO "requestId" /// string requestId = string.Empty; Alachisoft.NCache.Common.Protobuf.GetLoggingInfoCommand getLoggingInfoCommand = command.getLoggingInfoCommand; requestId = getLoggingInfoCommand.requestId.ToString(); bool errorEnabled = ConnectionManager.GetClientLoggingInfo(LoggingInfo.LoggingType.Error) == LoggingInfo.LogsStatus.Enable; bool detailedEnabled = ConnectionManager.GetClientLoggingInfo(LoggingInfo.LoggingType.Detailed) == LoggingInfo.LogsStatus.Enable; if (!errorEnabled) { detailedEnabled = false; } try { Alachisoft.NCache.Common.Protobuf.Response response = new Alachisoft.NCache.Common.Protobuf.Response(); Alachisoft.NCache.Common.Protobuf.GetLoggingInfoResponse loggingInfoResponse = new Alachisoft.NCache.Common.Protobuf.GetLoggingInfoResponse(); response.requestId = command.requestID; response.commandID = command.commandID; loggingInfoResponse.errorsEnabled = errorEnabled; loggingInfoResponse.detailedErrorsEnabled = detailedEnabled; response.getLoggingInfoResponse = loggingInfoResponse; response.responseType = Alachisoft.NCache.Common.Protobuf.Response.Type.GET_LOGGING_INFO; //_resultPacket = clientManager.ReplyPacket("GETLOGGINGINFORESULT \"" + requestId + "\"" + errorEnabled + "\"" + detailedEnabled + "\"", new byte[0]); _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeResponse(response, Common.Protobuf.Response.Type.GET_LOGGING_INFO)); } catch (Exception exc) { _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeExceptionResponseWithType(exc, command.requestID, command.commandID, clientManager.ClientVersion)); } }