|
|
|
@ -395,13 +395,20 @@ func logEntry(request *url.URL, status int, size int64, elapsed time.Duration) [
|
|
|
|
|
hostFormatted += ":1965" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
timeFormatted := time.Now().Format("02/Jan/2006 03:04:05") |
|
|
|
|
|
|
|
|
|
timeFormatted := time.Now().Format("2006-01-02 15:04:05") |
|
|
|
|
|
|
|
|
|
pathFormatted := request.Path |
|
|
|
|
if pathFormatted == "" { |
|
|
|
|
pathFormatted = "-" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sizeFormatted := "-" |
|
|
|
|
if size >= 0 { |
|
|
|
|
sizeFormatted = strconv.FormatInt(size, 10) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return []byte(fmt.Sprintf(`%s - - - [%s] "GET %s Gemini" %d %s %.4f`, hostFormatted, timeFormatted, request.Path, status, sizeFormatted, elapsed.Seconds())) |
|
|
|
|
return []byte(fmt.Sprintf(`%s - - - [%s] "GET %s Gemini" %d %s %.4f`, hostFormatted, timeFormatted, pathFormatted, status, sizeFormatted, elapsed.Seconds())) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func handleListener(l net.Listener) { |
|
|
|
|