outposts/ldap: fix log formatter and level not being set correctly
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
dcbc3d788a
commit
fc9d270992
|
@ -21,6 +21,12 @@ Required environment variables:
|
|||
|
||||
func main() {
|
||||
log.SetLevel(log.DebugLevel)
|
||||
log.SetFormatter(&log.JSONFormatter{
|
||||
FieldMap: log.FieldMap{
|
||||
log.FieldKeyMsg: "event",
|
||||
log.FieldKeyTime: "timestamp",
|
||||
},
|
||||
})
|
||||
akURL, found := os.LookupEnv("AUTHENTIK_HOST")
|
||||
if !found {
|
||||
fmt.Println("env AUTHENTIK_HOST not set!")
|
||||
|
|
|
@ -14,7 +14,8 @@ import (
|
|||
|
||||
func doGlobalSetup(outpost api.Outpost, globalConfig api.Config) {
|
||||
l := log.WithField("logger", "authentik.outpost")
|
||||
if !outpost.Managed.IsSet() {
|
||||
m := outpost.Managed.Get()
|
||||
if m == nil || *m == "" {
|
||||
switch outpost.Config[ConfigLogLevel].(string) {
|
||||
case "trace":
|
||||
log.SetLevel(log.TraceLevel)
|
||||
|
|
|
@ -57,7 +57,7 @@ func (ls *LDAPServer) StartLDAPServer() error {
|
|||
proxyListener := &proxyproto.Listener{Listener: ln}
|
||||
defer proxyListener.Close()
|
||||
|
||||
ls.log.WithField("listen", listen).Info("Starting ldap server")
|
||||
ls.log.WithField("listen", listen).Info("Starting LDAP server")
|
||||
err = ls.s.Serve(proxyListener)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -45,7 +45,7 @@ func (ls *LDAPServer) StartLDAPTLSServer() error {
|
|||
|
||||
tln := tls.NewListener(proxyListener, tlsConfig)
|
||||
|
||||
ls.log.WithField("listen", listen).Info("Starting ldap tls server")
|
||||
ls.log.WithField("listen", listen).Info("Starting LDAP SSL server")
|
||||
err = ls.s.Serve(tln)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Reference in a new issue