yamldef.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package main
  2. type FrontendConfigYAML struct {
  3. LogConfig LogConfigYAML `yaml:"log"`
  4. }
  5. type LogConfigYAML struct {
  6. AccessLogEnable bool `yaml:"access_log_enable"`
  7. RollingLogConfig RollingLoggerConfigYAML `yaml:"rolling_logger_config"`
  8. AccessLoggerDetailConfig AccessLoggerConfigYAML `yaml:"access_logger_config"`
  9. ErrorLoggerDetailConfig ErrorLoggerConfigYAML `yaml:"error_logger_config"`
  10. }
  11. type RollingLoggerConfigYAML struct {
  12. ErrLogCfg LumberjackLoggerYAML `yaml:"error_log"`
  13. AccessLogCfg LumberjackLoggerYAML `yaml:"access_log"`
  14. }
  15. type LumberjackLoggerYAML struct {
  16. FileName string `yaml:"file"`
  17. MaxSize int `yaml:"max_size"`
  18. MaxAge int `yaml:"max_age"`
  19. MaxBackups int `yaml:"max_backups"`
  20. UseLocalTime bool `yaml:"use_local_time"`
  21. Compress bool `yaml:"compress_history"`
  22. }
  23. type AccessLoggerConfigYAML struct {
  24. OutputLevel string `yaml:"output_level"`
  25. SuccessLevel string `yaml:"success_level"`
  26. NotFoundLevel string `yaml:"not_found_level"`
  27. ForbiddenLevel string `yaml:"forbidden_level"`
  28. GatewayErrorLevel string `yaml:"gateway_error_level"`
  29. InternalErrorLevel string `yaml:"internal_error_level"`
  30. LogFormat string `yaml:"log_format"`
  31. }
  32. type ErrorLoggerConfigYAML struct {
  33. OutputLevel string `yaml:"output_level"`
  34. LogFormat string `yaml:"log_format"`
  35. }