From 1daa5e69b1b1eb8f985e2faad3c13087b3322609 Mon Sep 17 00:00:00 2001 From: rojer Date: Mon, 13 Jun 2016 13:20:45 +0100 Subject: [PATCH] Add timestamp to LB log PUBLISHED_FROM=61b87fcee909241d5bdf2ba7407003c0c3cfbd72 --- examples/load_balancer/load_balancer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/load_balancer/load_balancer.c b/examples/load_balancer/load_balancer.c index f8e50c28..1dcbd42d 100644 --- a/examples/load_balancer/load_balancer.c +++ b/examples/load_balancer/load_balancer.c @@ -277,8 +277,9 @@ static int connect_backend(struct conn_data *conn, struct http_message *hm) { struct mg_connection *nc = conn->client.nc; struct http_backend *be = choose_backend(hm); - write_log("%.*s %.*s backend=%s\n", (int) hm->method.len, hm->method.p, - (int) hm->uri.len, hm->uri.p, be ? be->host_port : "not defined"); + write_log("%ld %.*s %.*s backend=%s\n", (long) time(NULL), + (int) hm->method.len, hm->method.p, (int) hm->uri.len, hm->uri.p, + be ? be->host_port : "not defined"); if (be == NULL) return 0; if (be->redirect != 0) {