diff options
author | pjd <pjd@FreeBSD.org> | 2011-03-21 08:33:58 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2011-03-21 08:33:58 +0000 |
commit | 5b7b8f48e306ee5dc231b9cd7efa85ee92200864 (patch) | |
tree | eddda6a2c1317abcb85e68ce9f871ad1a33c26da /sbin | |
parent | 102418c6cd4112e26606b49157d678ce4b68aad3 (diff) | |
download | FreeBSD-src-5b7b8f48e306ee5dc231b9cd7efa85ee92200864.zip FreeBSD-src-5b7b8f48e306ee5dc231b9cd7efa85ee92200864.tar.gz |
When creating connection on behalf of primary worker, set pjdlog prefix
to resource name and role, so that any logs related to that can be identified
properly.
MFC after: 1 week
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/hastd/hastd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sbin/hastd/hastd.c b/sbin/hastd/hastd.c index 4688ed5..d1b8e9f 100644 --- a/sbin/hastd/hastd.c +++ b/sbin/hastd/hastd.c @@ -842,6 +842,8 @@ connection_migrate(struct hast_resource *res) struct proto_conn *conn; int16_t val = 0; + pjdlog_prefix_set("[%s] (%s) ", res->hr_name, role2str(res->hr_role)); + if (proto_recv(res->hr_conn, &val, sizeof(val)) < 0) { pjdlog_errno(LOG_WARNING, "Unable to receive connection command"); @@ -869,6 +871,8 @@ out: } if (val == 0 && proto_connection_send(res->hr_conn, conn) < 0) pjdlog_errno(LOG_WARNING, "Unable to send connection"); + + pjdlog_prefix_set("%s", ""); } static void |