nmdc-log-service: fix opening files on linux

This commit is contained in:
mappu 2016-04-03 13:29:49 +12:00
parent 3a67b02bd9
commit b0e1c3e5d8

View File

@ -37,7 +37,7 @@ func LogMessage(hub, message string) {
// Produce a timestamp
timeStamp := instant.Format("2006-01-02 15:04:05")
fh, err := os.OpenFile(logFilePath, os.O_APPEND|os.O_CREATE, 0644)
fh, err := os.OpenFile(logFilePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
fmt.Fprintf(os.Stderr, "Couldn't open file '%s': %s\n", logFilePath, err.Error())
return