Skip to content

Commit a58aae9

Browse files
committed
fix(config): move syslog option to root
1 parent b6a78c7 commit a58aae9

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

cli/cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func Execute() {
7373
func runService() {
7474
store := createStore("root")
7575

76-
initSyslog(util.Config.Log.Channels.Syslog)
76+
initSyslog(util.Config.Syslog)
7777

7878
state := proTasks.NewTaskStateStore()
7979
terraformStore := proFactory.NewTerraformStore(store)

cli/cmd/syslog.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ func initSyslog(conf *util.SyslogConfig) {
1616
hook, err := lSyslog.NewSyslogHook(conf.Network, conf.Address, syslog.LOG_DEBUG, conf.Tag)
1717
if err == nil {
1818
log.AddHook(hook)
19+
log.Info("Syslog logging enabled")
1920
} else {
2021
log.WithError(err).Fatal("Failed to create syslog hook")
2122
}

util/config.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,9 @@ type TaskLogType struct {
158158
ResultLogger *lumberjack.Logger `json:"result_logger,omitempty" env:"SEMAPHORE_TASK_RESULT_LOGGER"`
159159
}
160160

161-
type ConfigLogChannels struct {
162-
Syslog *SyslogConfig `json:"syslog,omitempty"`
163-
}
164-
165161
type ConfigLog struct {
166-
Events *EventLogType `json:"events,omitempty"`
167-
Tasks *TaskLogType `json:"tasks,omitempty"`
168-
Channels *ConfigLogChannels `json:"channels,omitempty"`
162+
Events *EventLogType `json:"events,omitempty"`
163+
Tasks *TaskLogType `json:"tasks,omitempty"`
169164
}
170165

171166
type SyslogConfig struct {
@@ -324,6 +319,8 @@ type ConfigType struct {
324319

325320
Teams *TeamsConfig `json:"teams,omitempty"`
326321

322+
Syslog *SyslogConfig `json:"syslog,omitempty"`
323+
327324
Log *ConfigLog `json:"log,omitempty"`
328325

329326
Process *ConfigProcess `json:"process,omitempty"`

0 commit comments

Comments
 (0)