Commit d7116145 authored by Joerg-Holger Panzer's avatar Joerg-Holger Panzer
Browse files

Remove log hook

parent a75921b0
......@@ -16,9 +16,7 @@ import (
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/go-redis/redis"
"github.com/olivere/elastic"
"github.com/sirupsen/logrus"
"gopkg.in/sohlich/elogrus.v3"
sub "gitlab.gwdg.de/subugoe/shared-product-configs/sub"
......@@ -116,21 +114,23 @@ func init() {
}
if config.LogESURL != "" && config.LogESIndex != "" {
log.Infof("Setting ES Logging index to %s on %s", config.LogESIndex, config.LogESURL)
client, err := elastic.NewClient(elastic.SetURL(config.LogESURL))
if err != nil {
log.Panic(err)
}
serviceName := strings.Split(filepath.Base(config.LogFile), ".")[0]
var logLevel logrus.Level
logLevel, _ = logrus.ParseLevel(config.LogLevel)
hook, err := elogrus.NewAsyncElasticHook(client, serviceName, logLevel, config.LogESIndex)
if err != nil {
log.Panic(err)
/*
if config.ElasticsearchHost != "" && config.LogESIndex != "" {
log.Infof("Setting ES Logging index to %s on %s", config.LogESIndex, config.ElasticsearchHost)
client, err := elastic.NewClient(elastic.SetURL(config.ElasticsearchHost))
if err != nil {
log.Panic(err)
}
serviceName := strings.Split(filepath.Base(config.LogFile), ".")[0]
var logLevel logrus.Level
logLevel, _ = logrus.ParseLevel(config.LogLevel)
hook, err := elogrus.NewAsyncElasticHook(client, serviceName, logLevel, config.LogESIndex)
if err != nil {
log.Panic(err)
}
log.Hooks.Add(hook)
}
log.Hooks.Add(hook)
}
*/
}
inClient = getS3Client()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment