From 4edc4f84b09e65c455fa96b5eb8ab769803fd12b Mon Sep 17 00:00:00 2001 From: ShiKhu Date: Fri, 23 Jul 2021 18:15:17 +0800 Subject: [PATCH] log(backend): log on each service start --- backend/entrypoint.sh | 4 +--- backend/services/assets/main.go | 1 + backend/services/db/main.go | 1 + backend/services/ender/main.go | 1 + backend/services/http/handlers_depricated.go | 1 + backend/services/sink/main.go | 2 +- backend/services/storage/main.go | 2 +- 7 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 backend/services/http/handlers_depricated.go diff --git a/backend/entrypoint.sh b/backend/entrypoint.sh index e8276af92..d0eda9d01 100755 --- a/backend/entrypoint.sh +++ b/backend/entrypoint.sh @@ -1,5 +1,3 @@ #!/bin/sh -echo "hifromentrypoint" - -for name in alerts assets db ender http integrations sink storage;do nohup bin/$name | awk -v log_from="[$name]: " '{print log_from, $0}' ; done \ No newline at end of file +for name in assets alerts db ender http integrations sink storage;do nohup bin/$name | awk -v log_from="[$name]: " '{print log_from, $0}' ; done \ No newline at end of file diff --git a/backend/services/assets/main.go b/backend/services/assets/main.go index da7a92bbe..05c779bbb 100644 --- a/backend/services/assets/main.go +++ b/backend/services/assets/main.go @@ -58,6 +58,7 @@ func main() { sigchan := make(chan os.Signal, 1) signal.Notify(sigchan, syscall.SIGINT, syscall.SIGTERM) + log.Printf("Cacher service started\n") for { select { case sig := <-sigchan: diff --git a/backend/services/db/main.go b/backend/services/db/main.go index 649c77bef..a2cef41b3 100644 --- a/backend/services/db/main.go +++ b/backend/services/db/main.go @@ -79,6 +79,7 @@ func main() { tick := time.Tick(15 * time.Second) + log.Printf("Db service started\n") for { select { case sig := <-sigchan: diff --git a/backend/services/ender/main.go b/backend/services/ender/main.go index d1e83e545..e99c6866c 100644 --- a/backend/services/ender/main.go +++ b/backend/services/ender/main.go @@ -47,6 +47,7 @@ func main() { sigchan := make(chan os.Signal, 1) signal.Notify(sigchan, syscall.SIGINT, syscall.SIGTERM) + log.Printf("Ender service started\n") for { select { case sig := <-sigchan: diff --git a/backend/services/http/handlers_depricated.go b/backend/services/http/handlers_depricated.go new file mode 100644 index 000000000..85f0393b7 --- /dev/null +++ b/backend/services/http/handlers_depricated.go @@ -0,0 +1 @@ +package main \ No newline at end of file diff --git a/backend/services/sink/main.go b/backend/services/sink/main.go index a4f2d6273..52227805f 100644 --- a/backend/services/sink/main.go +++ b/backend/services/sink/main.go @@ -64,7 +64,7 @@ func main() { tick := time.Tick(30 * time.Second) - log.Println("Start consuming") + log.Printf("Sink service started\n") for { select { case sig := <-sigchan: diff --git a/backend/services/storage/main.go b/backend/services/storage/main.go index 3d3ba829f..5033fb845 100644 --- a/backend/services/storage/main.go +++ b/backend/services/storage/main.go @@ -68,7 +68,7 @@ func main() { cleanTick := time.Tick(time.Duration(FS_CLEAN_HRS) * time.Hour) - log.Println("Storage: start consuming") + log.Printf("Storage service started\n") for { select { case sig := <-sigchan: