From 18284a5580ddbaf655da3e43d9cdee299e6c7845 Mon Sep 17 00:00:00 2001 From: Arthur Barr Date: Thu, 5 Oct 2017 15:11:05 +0100 Subject: [PATCH] Remove log mirroring --- cmd/runmqserver/main.go | 56 ++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/cmd/runmqserver/main.go b/cmd/runmqserver/main.go index 1f3d8ea..8448f4a 100644 --- a/cmd/runmqserver/main.go +++ b/cmd/runmqserver/main.go @@ -30,7 +30,6 @@ import ( "strings" "syscall" - "github.com/hpcloud/tail" "golang.org/x/sys/unix" ) @@ -187,6 +186,7 @@ func updateCommandLevel() { } func startQueueManager() { + log.Println("Starting queue manager") out, rc, err := runCommand("strmqm") if err != nil { log.Fatalf("Error %v starting queue manager: %v", rc, string(out)) @@ -276,32 +276,32 @@ func createReaper() { // mirrorLog tails the specified file, and logs each line. // This is useful for usability, as the container console log can show // messages from the MQ log. -func mirrorLog(path string) error { - tail, err := tail.TailFile(path, tail.Config{ - ReOpen: true, - Follow: true, - Poll: true, - Location: &tail.SeekInfo{ - Offset: 0, - // End of file - Whence: 2, - }, - Logger: tail.DiscardingLogger, - }) - if err != nil { - return err - } - go func() { - for line := range tail.Lines { - // TODO: Unless we parse the message, the timestamp will be (slightly) wrong - if strings.HasPrefix(line.Text, "AMQ") { - // TODO: Extended characters don't print correctly - log.Println(line.Text) - } - } - }() - return nil -} +// func mirrorLog(path string) error { +// tail, err := tail.TailFile(path, tail.Config{ +// ReOpen: true, +// Follow: true, +// Poll: true, +// Location: &tail.SeekInfo{ +// Offset: 0, +// // End of file +// Whence: 2, +// }, +// Logger: tail.DiscardingLogger, +// }) +// if err != nil { +// return err +// } +// go func() { +// for line := range tail.Lines { +// // TODO: Unless we parse the message, the timestamp will be (slightly) wrong +// if strings.HasPrefix(line.Text, "AMQ") { +// // TODO: Extended characters don't print correctly +// log.Println(line.Text) +// } +// } +// }() +// return nil +// } func main() { createReaper() @@ -321,7 +321,7 @@ func main() { log.Fatal(err) } createDirStructure() - mirrorLog("/var/mqm/qmgrs/" + name + "/errors/AMQERR01.LOG") + //mirrorLog("/var/mqm/qmgrs/" + name + "/errors/AMQERR01.LOG") createQueueManager(name) updateCommandLevel() startQueueManager()