log(backend): log on each service start

This commit is contained in:
ShiKhu 2021-07-23 18:15:17 +08:00
parent b8fbea0c96
commit 4edc4f84b0
7 changed files with 7 additions and 5 deletions

View file

@ -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
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

View file

@ -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:

View file

@ -79,6 +79,7 @@ func main() {
tick := time.Tick(15 * time.Second)
log.Printf("Db service started\n")
for {
select {
case sig := <-sigchan:

View file

@ -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:

View file

@ -0,0 +1 @@
package main

View file

@ -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:

View file

@ -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: