From dev-return-2110-apmail-tephra-dev-archive=tephra.apache.org@tephra.incubator.apache.org Thu Apr 26 09:18:04 2018 Return-Path: X-Original-To: apmail-tephra-dev-archive@minotaur.apache.org Delivered-To: apmail-tephra-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7518E174C9 for ; Thu, 26 Apr 2018 09:18:04 +0000 (UTC) Received: (qmail 67760 invoked by uid 500); 26 Apr 2018 09:18:04 -0000 Delivered-To: apmail-tephra-dev-archive@tephra.apache.org Received: (qmail 67577 invoked by uid 500); 26 Apr 2018 09:18:04 -0000 Mailing-List: contact dev-help@tephra.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tephra.incubator.apache.org Delivered-To: mailing list dev@tephra.incubator.apache.org Received: (qmail 67562 invoked by uid 99); 26 Apr 2018 09:18:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2018 09:18:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 84C46180513 for ; Thu, 26 Apr 2018 09:18:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id ixL7vf3_pqzl for ; Thu, 26 Apr 2018 09:18:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 2DE805FCD7 for ; Thu, 26 Apr 2018 09:18:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 4C97BE1281 for ; Thu, 26 Apr 2018 09:18:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 82831210A4 for ; Thu, 26 Apr 2018 09:18:00 +0000 (UTC) Date: Thu, 26 Apr 2018 09:18:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@tephra.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (TEPHRA-266) Identify log messages when multiple instances of Tephra run on a single HBase cluster MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/TEPHRA-266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16453733#comment-16453733 ] ASF GitHub Bot commented on TEPHRA-266: --------------------------------------- Github user anew commented on a diff in the pull request: https://github.com/apache/incubator-tephra/pull/74#discussion_r184322363 --- Diff: tephra-core/src/main/java/org/apache/tephra/coprocessor/TransactionStateCache.java --- @@ -184,4 +185,14 @@ private void refreshState() throws IOException { public TransactionVisibilityState getLatestState() { return latestState; } + + protected void setId(@Nullable String id) { + if (id != null) { + this.logPrefix = "[" + id + "] "; + } + } + + private String prefixLog(String message) { --- End diff -- not sure this is a very good idea. It means you are performing the string operations even when it is not being logged (for example, for debug messages). Better to add the logPrefix as an argument to the log message, such as: ``` LOG.debug("[{}] Latest transaction snapshot: {}", logPrefix, latestState.toString())); ``` > Identify log messages when multiple instances of Tephra run on a single HBase cluster > ------------------------------------------------------------------------------------- > > Key: TEPHRA-266 > URL: https://issues.apache.org/jira/browse/TEPHRA-266 > Project: Tephra > Issue Type: Improvement > Environment: > Reporter: Poorna Chandra > Assignee: Poorna Chandra > Priority: Major > Fix For: 0.14.0-incubating > > > When multiple instances of Tehpra are run in a single HBase cluster, the log messages from the co-processors of all instances (which are identical except for the timestamp) go into a single region server log file. It becomes very difficult to figure out issues of an instance due to this. > it would be good if instance id is logged along with the co-processor log messages so that we can identity which messages belong to which instance of Tephra. -- This message was sent by Atlassian JIRA (v7.6.3#76005)