Skip to content

Commit

Permalink
Merge pull request #561 from jmpsec/default-logger-admin
Browse files Browse the repository at this point in the history
Different default logger file for osctrl-admin
  • Loading branch information
javuto authored Nov 7, 2024
2 parents bedfd82 + dd640b0 commit 621ec8a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions admin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const (
// Default redis configuration file
defRedisConfigurationFile string = "config/redis.json"
// Default Logger configuration file
defLoggerConfigurationFile string = "config/logger.json"
defLoggerConfigurationFile string = "config/logger_admin.json"
// Default TLS certificate file
defTLSCertificateFile string = "config/tls.crt"
// Default TLS private key file
Expand Down Expand Up @@ -736,6 +736,7 @@ func osctrlAdminService() {

// FIXME Redis cache - Ticker to cleanup sessions
// FIXME splay this?
log.Info().Msg("Initialize cleanup sessions")
go func() {
_t := settingsmgr.CleanupSessions()
if _t == 0 {
Expand All @@ -751,6 +752,7 @@ func osctrlAdminService() {
}()

// Goroutine to cleanup expired queries and carves
log.Info().Msg("Initialize cleanup queries/carves")
go func() {
_t := settingsmgr.CleanupExpired()
if _t == 0 {
Expand Down Expand Up @@ -786,6 +788,7 @@ func osctrlAdminService() {
}

// Initialize Admin handlers before router
log.Info().Msg("Initializing handlers")
handlersAdmin = handlers.CreateHandlersAdmin(
handlers.WithDB(db.Conn),
handlers.WithEnvs(envs),
Expand All @@ -809,9 +812,7 @@ func osctrlAdminService() {
)

// ////////////////////////// ADMIN
if settingsmgr.DebugService(settings.ServiceAdmin) {
log.Debug().Msg("DebugService: Creating router")
}
log.Info().Msg("Initializing router")
// Create router for admin
adminMux := http.NewServeMux()

Expand Down

0 comments on commit 621ec8a

Please sign in to comment.