|
22 | 22 | opsNatsSubject string |
23 | 23 | opsNatsMetricsSubject string |
24 | 24 | opsLogToStdout bool |
| 25 | + opsLogPrettyPrint bool |
25 | 26 | opsLogRetentionDays int |
26 | 27 | opsMaxLogFileSize int64 |
27 | 28 | opsPromEnabled bool |
@@ -128,6 +129,7 @@ Following this configuration change, the RadosGW will log operations to the file |
128 | 129 | NatsSubject: opsNatsSubject, |
129 | 130 | NatsMetricsSubject: opsNatsMetricsSubject, |
130 | 131 | LogToStdout: opsLogToStdout, |
| 132 | + LogPrettyPrint: opsLogPrettyPrint, |
131 | 133 | LogRetentionDays: opsLogRetentionDays, |
132 | 134 | MaxLogFileSize: opsMaxLogFileSize, |
133 | 135 | Prometheus: opsPromEnabled, |
@@ -232,6 +234,10 @@ Following this configuration change, the RadosGW will log operations to the file |
232 | 234 | event.Bool("log_to_stdout", config.LogToStdout) |
233 | 235 | } |
234 | 236 |
|
| 237 | + if config.LogPrettyPrint { |
| 238 | + event.Bool("log_pretty_print", config.LogPrettyPrint) |
| 239 | + } |
| 240 | + |
235 | 241 | event.Int("log_retention_days", config.LogRetentionDays) |
236 | 242 | event.Int64("max_log_file_size", config.MaxLogFileSize) |
237 | 243 |
|
@@ -530,6 +536,7 @@ func mergeOpsLogConfigWithEnv(cfg opslog.OpsLogConfig) opslog.OpsLogConfig { |
530 | 536 | cfg.NatsSubject = getEnv("NATS_SUBJECT", cfg.NatsSubject) |
531 | 537 | cfg.NatsMetricsSubject = getEnv("NATS_METRICS_SUBJECT", cfg.NatsMetricsSubject) |
532 | 538 | cfg.LogToStdout = getEnvBool("LOG_TO_STDOUT", cfg.LogToStdout) |
| 539 | + cfg.LogPrettyPrint = getEnvBool("LOG_PRETTY_PRINT", cfg.LogPrettyPrint) |
533 | 540 | cfg.LogRetentionDays = getEnvInt("LOG_RETENTION_DAYS", cfg.LogRetentionDays) |
534 | 541 | cfg.MaxLogFileSize = getEnvInt64("MAX_LOG_FILE_SIZE", cfg.MaxLogFileSize) |
535 | 542 | cfg.PrometheusPort = getEnvInt("PROMETHEUS_PORT", cfg.PrometheusPort) |
@@ -618,6 +625,7 @@ func init() { |
618 | 625 | opsLogCmd.Flags().StringVar(&opsNatsSubject, "nats-subject", "rgw.s3.ops", "NATS subject to publish results") |
619 | 626 | opsLogCmd.Flags().StringVar(&opsNatsMetricsSubject, "nats-metrics-subject", "rgw.s3.ops.aggregated.metrics", "NATS subject to publish aggregated metrics") |
620 | 627 | opsLogCmd.Flags().BoolVar(&opsLogToStdout, "log-to-stdout", false, "Log operations to stdout instead of a file") |
| 628 | + opsLogCmd.Flags().BoolVar(&opsLogPrettyPrint, "log-pretty-print", false, "Enable pretty printing for log output") |
621 | 629 | opsLogCmd.Flags().IntVar(&opsLogRetentionDays, "log-retention-days", 1, "Number of days to retain old log files") |
622 | 630 | opsLogCmd.Flags().Int64Var(&opsMaxLogFileSize, "max-log-file-size", 10, "Maximum log file size in MB before rotation (e.g., 10 for 10 MB)") |
623 | 631 | opsLogCmd.Flags().BoolVar(&opsPromEnabled, "prometheus", false, "Enable Prometheus metrics") |
|
0 commit comments