Browse Source

rework protocol buffer log settings

Shelikhoo 4 years ago
parent
commit
ee185a5824

+ 120 - 66
app/log/config.pb.go

@@ -74,20 +74,18 @@ func (LogType) EnumDescriptor() ([]byte, []int) {
 	return file_app_log_config_proto_rawDescGZIP(), []int{0}
 	return file_app_log_config_proto_rawDescGZIP(), []int{0}
 }
 }
 
 
-type Config struct {
+type LogSpecification struct {
 	state         protoimpl.MessageState
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 	unknownFields protoimpl.UnknownFields
 
 
-	ErrorLogType  LogType      `protobuf:"varint,1,opt,name=error_log_type,json=errorLogType,proto3,enum=v2ray.core.app.log.LogType" json:"error_log_type,omitempty"`
-	ErrorLogLevel log.Severity `protobuf:"varint,2,opt,name=error_log_level,json=errorLogLevel,proto3,enum=v2ray.core.common.log.Severity" json:"error_log_level,omitempty"`
-	ErrorLogPath  string       `protobuf:"bytes,3,opt,name=error_log_path,json=errorLogPath,proto3" json:"error_log_path,omitempty"`
-	AccessLogType LogType      `protobuf:"varint,4,opt,name=access_log_type,json=accessLogType,proto3,enum=v2ray.core.app.log.LogType" json:"access_log_type,omitempty"`
-	AccessLogPath string       `protobuf:"bytes,5,opt,name=access_log_path,json=accessLogPath,proto3" json:"access_log_path,omitempty"`
+	Type  LogType      `protobuf:"varint,1,opt,name=type,proto3,enum=v2ray.core.app.log.LogType" json:"type,omitempty"`
+	Level log.Severity `protobuf:"varint,2,opt,name=level,proto3,enum=v2ray.core.common.log.Severity" json:"level,omitempty"`
+	Path  string       `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
 }
 }
 
 
-func (x *Config) Reset() {
-	*x = Config{}
+func (x *LogSpecification) Reset() {
+	*x = LogSpecification{}
 	if protoimpl.UnsafeEnabled {
 	if protoimpl.UnsafeEnabled {
 		mi := &file_app_log_config_proto_msgTypes[0]
 		mi := &file_app_log_config_proto_msgTypes[0]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -95,13 +93,13 @@ func (x *Config) Reset() {
 	}
 	}
 }
 }
 
 
-func (x *Config) String() string {
+func (x *LogSpecification) String() string {
 	return protoimpl.X.MessageStringOf(x)
 	return protoimpl.X.MessageStringOf(x)
 }
 }
 
 
-func (*Config) ProtoMessage() {}
+func (*LogSpecification) ProtoMessage() {}
 
 
-func (x *Config) ProtoReflect() protoreflect.Message {
+func (x *LogSpecification) ProtoReflect() protoreflect.Message {
 	mi := &file_app_log_config_proto_msgTypes[0]
 	mi := &file_app_log_config_proto_msgTypes[0]
 	if protoimpl.UnsafeEnabled && x != nil {
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -113,44 +111,85 @@ func (x *Config) ProtoReflect() protoreflect.Message {
 	return mi.MessageOf(x)
 	return mi.MessageOf(x)
 }
 }
 
 
-// Deprecated: Use Config.ProtoReflect.Descriptor instead.
-func (*Config) Descriptor() ([]byte, []int) {
+// Deprecated: Use LogSpecification.ProtoReflect.Descriptor instead.
+func (*LogSpecification) Descriptor() ([]byte, []int) {
 	return file_app_log_config_proto_rawDescGZIP(), []int{0}
 	return file_app_log_config_proto_rawDescGZIP(), []int{0}
 }
 }
 
 
-func (x *Config) GetErrorLogType() LogType {
+func (x *LogSpecification) GetType() LogType {
 	if x != nil {
 	if x != nil {
-		return x.ErrorLogType
+		return x.Type
 	}
 	}
 	return LogType_None
 	return LogType_None
 }
 }
 
 
-func (x *Config) GetErrorLogLevel() log.Severity {
+func (x *LogSpecification) GetLevel() log.Severity {
 	if x != nil {
 	if x != nil {
-		return x.ErrorLogLevel
+		return x.Level
 	}
 	}
 	return log.Severity(0)
 	return log.Severity(0)
 }
 }
 
 
-func (x *Config) GetErrorLogPath() string {
+func (x *LogSpecification) GetPath() string {
 	if x != nil {
 	if x != nil {
-		return x.ErrorLogPath
+		return x.Path
 	}
 	}
 	return ""
 	return ""
 }
 }
 
 
-func (x *Config) GetAccessLogType() LogType {
+type Config struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Error  *LogSpecification `protobuf:"bytes,6,opt,name=error,proto3" json:"error,omitempty"`
+	Access *LogSpecification `protobuf:"bytes,7,opt,name=access,proto3" json:"access,omitempty"`
+}
+
+func (x *Config) Reset() {
+	*x = Config{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_app_log_config_proto_msgTypes[1]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *Config) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Config) ProtoMessage() {}
+
+func (x *Config) ProtoReflect() protoreflect.Message {
+	mi := &file_app_log_config_proto_msgTypes[1]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use Config.ProtoReflect.Descriptor instead.
+func (*Config) Descriptor() ([]byte, []int) {
+	return file_app_log_config_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *Config) GetError() *LogSpecification {
 	if x != nil {
 	if x != nil {
-		return x.AccessLogType
+		return x.Error
 	}
 	}
-	return LogType_None
+	return nil
 }
 }
 
 
-func (x *Config) GetAccessLogPath() string {
+func (x *Config) GetAccess() *LogSpecification {
 	if x != nil {
 	if x != nil {
-		return x.AccessLogPath
+		return x.Access
 	}
 	}
-	return ""
+	return nil
 }
 }
 
 
 var File_app_log_config_proto protoreflect.FileDescriptor
 var File_app_log_config_proto protoreflect.FileDescriptor
@@ -162,36 +201,37 @@ var file_app_log_config_proto_rawDesc = []byte{
 	0x6f, 0x6e, 0x2f, 0x6c, 0x6f, 0x67, 0x2f, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
 	0x6f, 0x6e, 0x2f, 0x6c, 0x6f, 0x67, 0x2f, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
 	0x1a, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x65, 0x78,
 	0x1a, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x65, 0x78,
 	0x74, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f,
 	0x74, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f,
-	0x74, 0x6f, 0x22, 0xbf, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x41, 0x0a,
-	0x0e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18,
+	0x74, 0x6f, 0x22, 0x8e, 0x01, 0x0a, 0x10, 0x4c, 0x6f, 0x67, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66,
+	0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18,
 	0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f,
 	0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f,
 	0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x4c, 0x6f, 0x67, 0x54, 0x79,
 	0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x4c, 0x6f, 0x67, 0x54, 0x79,
-	0x70, 0x65, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65,
-	0x12, 0x47, 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, 0x65,
-	0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x76, 0x32, 0x72, 0x61,
-	0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6c, 0x6f,
-	0x67, 0x2e, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x52, 0x0d, 0x65, 0x72, 0x72, 0x6f,
-	0x72, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x72, 0x72,
-	0x6f, 0x72, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4c, 0x6f, 0x67, 0x50, 0x61, 0x74, 0x68, 0x12,
-	0x43, 0x0a, 0x0f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x74, 0x79,
-	0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79,
-	0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x4c, 0x6f,
-	0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x6f, 0x67,
-	0x54, 0x79, 0x70, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c,
-	0x6f, 0x67, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61,
-	0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x6f, 0x67, 0x50, 0x61, 0x74, 0x68, 0x3a, 0x16, 0x82, 0xb5,
-	0x18, 0x09, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x82, 0xb5, 0x18, 0x05, 0x12,
-	0x03, 0x6c, 0x6f, 0x67, 0x2a, 0x35, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12,
-	0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6e,
-	0x73, 0x6f, 0x6c, 0x65, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x10, 0x02,
-	0x12, 0x09, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x10, 0x03, 0x42, 0x57, 0x0a, 0x16, 0x63,
-	0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70,
-	0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x50, 0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
-	0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2d,
-	0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x34, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x6c, 0x6f, 0x67, 0xaa,
-	0x02, 0x12, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70,
-	0x2e, 0x4c, 0x6f, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65,
+	0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e,
+	0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6c, 0x6f, 0x67, 0x2e,
+	0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12,
+	0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70,
+	0x61, 0x74, 0x68, 0x22, 0xb8, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3a,
+	0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e,
+	0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c,
+	0x6f, 0x67, 0x2e, 0x4c, 0x6f, 0x67, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
+	0x69, 0x6f, 0x6e, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x63,
+	0x63, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x76, 0x32, 0x72,
+	0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x2e,
+	0x4c, 0x6f, 0x67, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+	0x52, 0x06, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x3a, 0x16, 0x82, 0xb5, 0x18, 0x09, 0x0a, 0x07,
+	0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x82, 0xb5, 0x18, 0x05, 0x12, 0x03, 0x6c, 0x6f, 0x67,
+	0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x4a, 0x04, 0x08, 0x03,
+	0x10, 0x04, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x2a, 0x35,
+	0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x6e,
+	0x65, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x10, 0x01,
+	0x12, 0x08, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x76,
+	0x65, 0x6e, 0x74, 0x10, 0x03, 0x42, 0x57, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72,
+	0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x50,
+	0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x32,
+	0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76,
+	0x34, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x6c, 0x6f, 0x67, 0xaa, 0x02, 0x12, 0x56, 0x32, 0x52, 0x61,
+	0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x4c, 0x6f, 0x67, 0x62, 0x06,
+	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 }
 
 
 var (
 var (
@@ -207,21 +247,23 @@ func file_app_log_config_proto_rawDescGZIP() []byte {
 }
 }
 
 
 var file_app_log_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
 var file_app_log_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
-var file_app_log_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
+var file_app_log_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
 var file_app_log_config_proto_goTypes = []interface{}{
 var file_app_log_config_proto_goTypes = []interface{}{
-	(LogType)(0),      // 0: v2ray.core.app.log.LogType
-	(*Config)(nil),    // 1: v2ray.core.app.log.Config
-	(log.Severity)(0), // 2: v2ray.core.common.log.Severity
+	(LogType)(0),             // 0: v2ray.core.app.log.LogType
+	(*LogSpecification)(nil), // 1: v2ray.core.app.log.LogSpecification
+	(*Config)(nil),           // 2: v2ray.core.app.log.Config
+	(log.Severity)(0),        // 3: v2ray.core.common.log.Severity
 }
 }
 var file_app_log_config_proto_depIdxs = []int32{
 var file_app_log_config_proto_depIdxs = []int32{
-	0, // 0: v2ray.core.app.log.Config.error_log_type:type_name -> v2ray.core.app.log.LogType
-	2, // 1: v2ray.core.app.log.Config.error_log_level:type_name -> v2ray.core.common.log.Severity
-	0, // 2: v2ray.core.app.log.Config.access_log_type:type_name -> v2ray.core.app.log.LogType
-	3, // [3:3] is the sub-list for method output_type
-	3, // [3:3] is the sub-list for method input_type
-	3, // [3:3] is the sub-list for extension type_name
-	3, // [3:3] is the sub-list for extension extendee
-	0, // [0:3] is the sub-list for field type_name
+	0, // 0: v2ray.core.app.log.LogSpecification.type:type_name -> v2ray.core.app.log.LogType
+	3, // 1: v2ray.core.app.log.LogSpecification.level:type_name -> v2ray.core.common.log.Severity
+	1, // 2: v2ray.core.app.log.Config.error:type_name -> v2ray.core.app.log.LogSpecification
+	1, // 3: v2ray.core.app.log.Config.access:type_name -> v2ray.core.app.log.LogSpecification
+	4, // [4:4] is the sub-list for method output_type
+	4, // [4:4] is the sub-list for method input_type
+	4, // [4:4] is the sub-list for extension type_name
+	4, // [4:4] is the sub-list for extension extendee
+	0, // [0:4] is the sub-list for field type_name
 }
 }
 
 
 func init() { file_app_log_config_proto_init() }
 func init() { file_app_log_config_proto_init() }
@@ -231,6 +273,18 @@ func file_app_log_config_proto_init() {
 	}
 	}
 	if !protoimpl.UnsafeEnabled {
 	if !protoimpl.UnsafeEnabled {
 		file_app_log_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
 		file_app_log_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*LogSpecification); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_app_log_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*Config); i {
 			switch v := v.(*Config); i {
 			case 0:
 			case 0:
 				return &v.state
 				return &v.state
@@ -249,7 +303,7 @@ func file_app_log_config_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_app_log_config_proto_rawDesc,
 			RawDescriptor: file_app_log_config_proto_rawDesc,
 			NumEnums:      1,
 			NumEnums:      1,
-			NumMessages:   1,
+			NumMessages:   2,
 			NumExtensions: 0,
 			NumExtensions: 0,
 			NumServices:   0,
 			NumServices:   0,
 		},
 		},

+ 9 - 5
app/log/config.proto

@@ -16,14 +16,18 @@ enum LogType {
   Event = 3;
   Event = 3;
 }
 }
 
 
+message LogSpecification {
+  LogType type = 1;
+  v2ray.core.common.log.Severity level = 2;
+  string path = 3;
+}
+
 message Config {
 message Config {
   option (v2ray.core.common.protoext.message_opt).type = "service";
   option (v2ray.core.common.protoext.message_opt).type = "service";
   option (v2ray.core.common.protoext.message_opt).short_name = "log";
   option (v2ray.core.common.protoext.message_opt).short_name = "log";
 
 
-  LogType error_log_type = 1;
-  v2ray.core.common.log.Severity error_log_level = 2;
-  string error_log_path = 3;
+  reserved 1,2,3,4,5;
 
 
-  LogType access_log_type = 4;
-  string access_log_path = 5;
+  LogSpecification error = 6;
+  LogSpecification access = 7;
 }
 }

+ 14 - 5
app/log/log.go

@@ -23,6 +23,15 @@ type Instance struct {
 
 
 // New creates a new log.Instance based on the given config.
 // New creates a new log.Instance based on the given config.
 func New(ctx context.Context, config *Config) (*Instance, error) {
 func New(ctx context.Context, config *Config) (*Instance, error) {
+
+	if config.Error == nil {
+		config.Error = &LogSpecification{Type: LogType_Console, Level: log.Severity_Warning}
+	}
+
+	if config.Access == nil {
+		config.Access = &LogSpecification{Type: LogType_None}
+	}
+
 	g := &Instance{
 	g := &Instance{
 		config: config,
 		config: config,
 		active: false,
 		active: false,
@@ -40,8 +49,8 @@ func New(ctx context.Context, config *Config) (*Instance, error) {
 }
 }
 
 
 func (g *Instance) initAccessLogger() error {
 func (g *Instance) initAccessLogger() error {
-	handler, err := createHandler(g.config.AccessLogType, HandlerCreatorOptions{
-		Path: g.config.AccessLogPath,
+	handler, err := createHandler(g.config.Access.Type, HandlerCreatorOptions{
+		Path: g.config.Access.Path,
 	})
 	})
 	if err != nil {
 	if err != nil {
 		return err
 		return err
@@ -51,8 +60,8 @@ func (g *Instance) initAccessLogger() error {
 }
 }
 
 
 func (g *Instance) initErrorLogger() error {
 func (g *Instance) initErrorLogger() error {
-	handler, err := createHandler(g.config.ErrorLogType, HandlerCreatorOptions{
-		Path: g.config.ErrorLogPath,
+	handler, err := createHandler(g.config.Error.Type, HandlerCreatorOptions{
+		Path: g.config.Error.Path,
 	})
 	})
 	if err != nil {
 	if err != nil {
 		return err
 		return err
@@ -127,7 +136,7 @@ func (g *Instance) Handle(msg log.Message) {
 			g.accessLogger.Handle(msg)
 			g.accessLogger.Handle(msg)
 		}
 		}
 	case *log.GeneralMessage:
 	case *log.GeneralMessage:
-		if g.errorLogger != nil && msg.Severity <= g.config.ErrorLogLevel {
+		if g.errorLogger != nil && msg.Severity <= g.config.Error.Level {
 			g.errorLogger.Handle(msg)
 			g.errorLogger.Handle(msg)
 		}
 		}
 	default:
 	default:

+ 2 - 3
app/log/log_test.go

@@ -28,9 +28,8 @@ func TestCustomLogHandler(t *testing.T) {
 	})
 	})
 
 
 	logger, err := log.New(context.Background(), &log.Config{
 	logger, err := log.New(context.Background(), &log.Config{
-		ErrorLogLevel: clog.Severity_Debug,
-		ErrorLogType:  log.LogType_Console,
-		AccessLogType: log.LogType_None,
+		Error:  &log.LogSpecification{Type: log.LogType_Console, Level: clog.Severity_Debug},
+		Access: &log.LogSpecification{Type: log.LogType_None},
 	})
 	})
 	common.Must(err)
 	common.Must(err)
 
 

+ 16 - 17
infra/conf/synthetic/log/log.go

@@ -9,9 +9,8 @@ import (
 
 
 func DefaultLogConfig() *log.Config {
 func DefaultLogConfig() *log.Config {
 	return &log.Config{
 	return &log.Config{
-		AccessLogType: log.LogType_None,
-		ErrorLogType:  log.LogType_Console,
-		ErrorLogLevel: clog.Severity_Warning,
+		Access: &log.LogSpecification{Type: log.LogType_None},
+		Error:  &log.LogSpecification{Type: log.LogType_Console, Level: clog.Severity_Warning},
 	}
 	}
 }
 }
 
 
@@ -26,36 +25,36 @@ func (v *LogConfig) Build() *log.Config {
 		return nil
 		return nil
 	}
 	}
 	config := &log.Config{
 	config := &log.Config{
-		ErrorLogType:  log.LogType_Console,
-		AccessLogType: log.LogType_Console,
+		Access: &log.LogSpecification{Type: log.LogType_Console},
+		Error:  &log.LogSpecification{Type: log.LogType_Console},
 	}
 	}
 
 
 	if v.AccessLog == "none" {
 	if v.AccessLog == "none" {
-		config.AccessLogType = log.LogType_None
+		config.Access.Type = log.LogType_None
 	} else if len(v.AccessLog) > 0 {
 	} else if len(v.AccessLog) > 0 {
-		config.AccessLogPath = v.AccessLog
-		config.AccessLogType = log.LogType_File
+		config.Access.Path = v.AccessLog
+		config.Access.Type = log.LogType_File
 	}
 	}
 	if v.ErrorLog == "none" {
 	if v.ErrorLog == "none" {
-		config.ErrorLogType = log.LogType_None
+		config.Error.Type = log.LogType_None
 	} else if len(v.ErrorLog) > 0 {
 	} else if len(v.ErrorLog) > 0 {
-		config.ErrorLogPath = v.ErrorLog
-		config.ErrorLogType = log.LogType_File
+		config.Error.Path = v.ErrorLog
+		config.Error.Type = log.LogType_File
 	}
 	}
 
 
 	level := strings.ToLower(v.LogLevel)
 	level := strings.ToLower(v.LogLevel)
 	switch level {
 	switch level {
 	case "debug":
 	case "debug":
-		config.ErrorLogLevel = clog.Severity_Debug
+		config.Error.Level = clog.Severity_Debug
 	case "info":
 	case "info":
-		config.ErrorLogLevel = clog.Severity_Info
+		config.Error.Level = clog.Severity_Info
 	case "error":
 	case "error":
-		config.ErrorLogLevel = clog.Severity_Error
+		config.Error.Level = clog.Severity_Error
 	case "none":
 	case "none":
-		config.ErrorLogType = log.LogType_None
-		config.AccessLogType = log.LogType_None
+		config.Error.Type = log.LogType_None
+		config.Error.Type = log.LogType_None
 	default:
 	default:
-		config.ErrorLogLevel = clog.Severity_Warning
+		config.Error.Level = clog.Severity_Warning
 	}
 	}
 	return config
 	return config
 }
 }

+ 9 - 5
infra/conf/v4/v2ray_test.go

@@ -149,11 +149,15 @@ func TestV2RayConfig(t *testing.T) {
 			Output: &core.Config{
 			Output: &core.Config{
 				App: []*anypb.Any{
 				App: []*anypb.Any{
 					serial.ToTypedMessage(&log.Config{
 					serial.ToTypedMessage(&log.Config{
-						ErrorLogType:  log.LogType_File,
-						ErrorLogPath:  "/var/log/v2ray/error.log",
-						ErrorLogLevel: clog.Severity_Error,
-						AccessLogType: log.LogType_File,
-						AccessLogPath: "/var/log/v2ray/access.log",
+						Error: &log.LogSpecification{
+							Type:  log.LogType_File,
+							Level: clog.Severity_Error,
+							Path:  "/var/log/v2ray/error.log",
+						},
+						Access: &log.LogSpecification{
+							Type: log.LogType_File,
+							Path: "/var/log/v2ray/access.log",
+						},
 					}),
 					}),
 					serial.ToTypedMessage(&dispatcher.Config{}),
 					serial.ToTypedMessage(&dispatcher.Config{}),
 					serial.ToTypedMessage(&proxyman.InboundConfig{}),
 					serial.ToTypedMessage(&proxyman.InboundConfig{}),

+ 2 - 4
testing/scenarios/dokodemo_test.go

@@ -38,8 +38,7 @@ func TestDokodemoTCP(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -71,8 +70,7 @@ func TestDokodemoTCP(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{

+ 2 - 4
testing/scenarios/feature_test.go

@@ -617,8 +617,7 @@ func TestDomainSniffing(t *testing.T) {
 				},
 				},
 			}),
 			}),
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 	}
 	}
@@ -661,8 +660,7 @@ func TestDialV2Ray(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{

+ 1 - 2
testing/scenarios/policy_test.go

@@ -210,8 +210,7 @@ func TestZeroBuffer(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{

+ 2 - 4
testing/scenarios/reverse_test.go

@@ -216,8 +216,7 @@ func TestReverseProxyLongRunning(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Warning,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 			serial.ToTypedMessage(&policy.Config{
 			serial.ToTypedMessage(&policy.Config{
 				Level: map[uint32]*policy.Policy{
 				Level: map[uint32]*policy.Policy{
@@ -299,8 +298,7 @@ func TestReverseProxyLongRunning(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Warning,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 			serial.ToTypedMessage(&policy.Config{
 			serial.ToTypedMessage(&policy.Config{
 				Level: map[uint32]*policy.Policy{
 				Level: map[uint32]*policy.Policy{

+ 6 - 12
testing/scenarios/shadowsocks_test.go

@@ -123,8 +123,7 @@ func TestShadowsocksAES256GCMTCP(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -153,8 +152,7 @@ func TestShadowsocksAES256GCMTCP(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -220,8 +218,7 @@ func TestShadowsocksAES128GCMUDP(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -250,8 +247,7 @@ func TestShadowsocksAES128GCMUDP(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -316,8 +312,7 @@ func TestShadowsocksAES128GCMUDPMux(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -346,8 +341,7 @@ func TestShadowsocksAES128GCMUDPMux(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{

+ 2 - 4
testing/scenarios/transport_test.go

@@ -263,8 +263,7 @@ func TestVMessQuic(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -310,8 +309,7 @@ func TestVMessQuic(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{

+ 26 - 52
testing/scenarios/vmess_test.go

@@ -45,8 +45,7 @@ func TestVMessDynamicPort(t *testing.T) {
 		serverConfig := &core.Config{
 		serverConfig := &core.Config{
 			App: []*anypb.Any{
 			App: []*anypb.Any{
 				serial.ToTypedMessage(&log.Config{
 				serial.ToTypedMessage(&log.Config{
-					ErrorLogLevel: clog.Severity_Debug,
-					ErrorLogType:  log.LogType_Console,
+					Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 				}),
 				}),
 			},
 			},
 			Inbound: []*core.InboundHandlerConfig{
 			Inbound: []*core.InboundHandlerConfig{
@@ -125,8 +124,7 @@ func TestVMessDynamicPort(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -204,8 +202,7 @@ func TestVMessGCM(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -237,8 +234,7 @@ func TestVMessGCM(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -310,8 +306,7 @@ func TestVMessGCMReadv(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -343,8 +338,7 @@ func TestVMessGCMReadv(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -419,8 +413,7 @@ func TestVMessGCMUDP(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -452,8 +445,7 @@ func TestVMessGCMUDP(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -522,8 +514,7 @@ func TestVMessChacha20(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -555,8 +546,7 @@ func TestVMessChacha20(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -626,8 +616,7 @@ func TestVMessNone(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -659,8 +648,7 @@ func TestVMessNone(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -729,8 +717,7 @@ func TestVMessKCP(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*any.Any{
 		App: []*any.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -765,8 +752,7 @@ func TestVMessKCP(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -840,8 +826,7 @@ func TestVMessKCPLarge(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -895,8 +880,7 @@ func TestVMessKCPLarge(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -993,8 +977,7 @@ func TestVMessGCMMux(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -1026,8 +1009,7 @@ func TestVMessGCMMux(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -1112,8 +1094,7 @@ func TestVMessGCMMuxUDP(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -1146,8 +1127,7 @@ func TestVMessGCMMuxUDP(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -1243,8 +1223,7 @@ func TestVMessZero(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -1276,8 +1255,7 @@ func TestVMessZero(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -1346,8 +1324,7 @@ func TestVMessGCMLengthAuth(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -1379,8 +1356,7 @@ func TestVMessGCMLengthAuth(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -1453,8 +1429,7 @@ func TestVMessGCMLengthAuthPlusNoTerminationSignal(t *testing.T) {
 	serverConfig := &core.Config{
 	serverConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{
@@ -1487,8 +1462,7 @@ func TestVMessGCMLengthAuthPlusNoTerminationSignal(t *testing.T) {
 	clientConfig := &core.Config{
 	clientConfig := &core.Config{
 		App: []*anypb.Any{
 		App: []*anypb.Any{
 			serial.ToTypedMessage(&log.Config{
 			serial.ToTypedMessage(&log.Config{
-				ErrorLogLevel: clog.Severity_Debug,
-				ErrorLogType:  log.LogType_Console,
+				Error: &log.LogSpecification{Level: clog.Severity_Debug, Type: log.LogType_Console},
 			}),
 			}),
 		},
 		},
 		Inbound: []*core.InboundHandlerConfig{
 		Inbound: []*core.InboundHandlerConfig{