Skip to content

Commit dc9407e

Browse files
committed
feat(logs): add file log format option
1 parent 37cf026 commit dc9407e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

util/config.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ type AuthConfig struct {
152152
}
153153

154154
type EventLogType struct {
155+
Format FileLogFormat `json:"format,omitempty" env:"SEMAPHORE_EVENT_LOG_FORMAT"`
155156
Enabled bool `json:"enabled" env:"SEMAPHORE_EVENT_LOG_ENABLED"`
156157
Logger *lumberjack.Logger `json:"logger,omitempty" env:"SEMAPHORE_EVENT_LOGGER"`
157158
}
@@ -164,8 +165,16 @@ type EventLogRecord struct {
164165
Description *string `json:"description,omitempty"`
165166
}
166167

168+
type FileLogFormat string
169+
170+
const (
171+
FileLogJSON FileLogFormat = "json"
172+
FileLogRaw FileLogFormat = "raw"
173+
)
174+
167175
type TaskLogType struct {
168176
Enabled bool `json:"enabled" env:"SEMAPHORE_TASK_LOG_ENABLED"`
177+
Format FileLogFormat `json:"format,omitempty" env:"SEMAPHORE_TASK_LOG_FORMAT"`
169178
Logger *lumberjack.Logger `json:"logger,omitempty" env:"SEMAPHORE_TASK_LOGGER"`
170179
ResultLogger *lumberjack.Logger `json:"result_logger,omitempty" env:"SEMAPHORE_TASK_RESULT_LOGGER"`
171180
}

0 commit comments

Comments
 (0)