Created
October 16, 2014 18:00
-
-
Save camsom/e7dbac956c68b6437e42 to your computer and use it in GitHub Desktop.
ey-o
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build | |
sudo docker build -t pokerap . | |
# run | |
sudo docker run -v /dev/log:/dev/log pokerap /go/bin/gokerap | |
# check syslog | |
sudo tail /var/log/syslog | |
# here are the cool lines I like | |
Oct 16 17:58:12 vagrant-ubuntu-trusty-64 go_log[1]: 2014/10/16 17:58:12 Docker is logging on the host machine. | |
Oct 16 17:58:12 vagrant-ubuntu-trusty-64 go_log[1]: 2014/10/16 17:58:12 GO LOGGING | |
#They're cool because of main.go | |
func main() { | |
logwriter, e := syslog.New(syslog.LOG_NOTICE, "go_log") | |
if e == nil { | |
fmt.Println("Hey Syslog") | |
log.SetOutput(logwriter) | |
} | |
log.Println("Docker is logging on the host machine.") | |
log.Print("GO LOGGING") | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment