-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Logging
Oliver Eilhard edited this page Feb 22, 2015
·
8 revisions
Logging and tracing in Elastic is done on the client-level. A log file in Elastic captures requests (e.g. URL, status code, duration) as well as events like marking dead connections or updating nodes after sniffing.
This logs to standard output:
client.SetLogger(log.New(os.Stdout, "ELASTIC ", log.LstdFlags))
If you want to log to a file, use something like this:
file, err := os.OpenFile("elastic.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0664)
if err != nil {
panic(err)
}
client.SetLogger(log.New(file, "ELASTIC ", log.LstdFlags))