Give an indication of the time zone in the log
We use Zulu-time (aka UTC) for the log timestamps.
This commit is contained in:
parent
3ff82c514b
commit
ba38b0969f
1 changed files with 2 additions and 2 deletions
4
main.c
4
main.c
|
@ -29,7 +29,7 @@ serve(int infd, struct sockaddr_storage *in_sa)
|
||||||
time_t t;
|
time_t t;
|
||||||
enum status status;
|
enum status status;
|
||||||
char inaddr[INET6_ADDRSTRLEN /* > INET_ADDRSTRLEN */];
|
char inaddr[INET6_ADDRSTRLEN /* > INET_ADDRSTRLEN */];
|
||||||
char tstmp[25];
|
char tstmp[21];
|
||||||
|
|
||||||
/* set connection timeout */
|
/* set connection timeout */
|
||||||
if (sock_set_timeout(infd, 30)) {
|
if (sock_set_timeout(infd, 30)) {
|
||||||
|
@ -43,7 +43,7 @@ serve(int infd, struct sockaddr_storage *in_sa)
|
||||||
|
|
||||||
/* write output to log */
|
/* write output to log */
|
||||||
t = time(NULL);
|
t = time(NULL);
|
||||||
if (!strftime(tstmp, sizeof(tstmp), "%Y-%m-%dT%H:%M:%S",
|
if (!strftime(tstmp, sizeof(tstmp), "%Y-%m-%dT%H:%M:%SZ",
|
||||||
gmtime(&t))) {
|
gmtime(&t))) {
|
||||||
warn("strftime: Exceeded buffer capacity");
|
warn("strftime: Exceeded buffer capacity");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
Loading…
Reference in a new issue