Return-Path: Delivered-To: apmail-incubator-cassandra-commits-archive@minotaur.apache.org Received: (qmail 60089 invoked from network); 9 Mar 2010 09:48:18 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Mar 2010 09:48:18 -0000 Received: (qmail 13883 invoked by uid 500); 9 Mar 2010 09:47:52 -0000 Delivered-To: apmail-incubator-cassandra-commits-archive@incubator.apache.org Received: (qmail 13799 invoked by uid 500); 9 Mar 2010 09:47:50 -0000 Mailing-List: contact cassandra-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cassandra-dev@incubator.apache.org Delivered-To: mailing list cassandra-commits@incubator.apache.org Received: (qmail 13791 invoked by uid 99); 9 Mar 2010 09:47:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Mar 2010 09:47:49 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Mar 2010 09:47:47 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 23C68234C4AC for ; Tue, 9 Mar 2010 09:47:27 +0000 (UTC) Message-ID: <1089277448.151761268128047132.JavaMail.jira@brutus.apache.org> Date: Tue, 9 Mar 2010 09:47:27 +0000 (UTC) From: "gabriele renzi (JIRA)" To: cassandra-commits@incubator.apache.org Subject: [jira] Commented: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code In-Reply-To: <563101451.1260518358088.JavaMail.jira@brutus> 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/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12842987#action_12842987 ] gabriele renzi commented on CASSANDRA-625: ------------------------------------------ No performance benefits (though it would allow switching to logback which is faster than log4j, I'm told) To me it's because of: * messageformatter-like statements are cleaner, and more robust than string concatenation * the ability to get rid of the "if logger.isFooEnabled" trick cause there is no need to avoid the infamous "expensive string concatenation" that happens only inside the logging method, where it is already guarded. * implicit management of null values avoids possible NPEs (see CASSANDRA-631) But mostly, when I started this patch there were no direct references to log4j-specific classes in the code, so cassandra deployments could use any of the underlying slf4j adapters for ease of integration with existing code without going into multiple loggers madness. We, for example, prefer logback ( http://logback.qos.ch/ ). I understand this is not really compelling though, but I was suggested to provide a patch and so I did it, I won't take it badly if it's not merged :) > Migrate to slf4j from log4j in cassandra code > --------------------------------------------- > > Key: CASSANDRA-625 > URL: https://issues.apache.org/jira/browse/CASSANDRA-625 > Project: Cassandra > Issue Type: Improvement > Components: Core > Environment: all > Reporter: gabriele renzi > Priority: Minor > Fix For: 0.7 > > Attachments: CASSANDRA-625.patch > > > currently code generated from thrift uses slf4j while cassandra uses raw log4j. > There are various level in which this can be changed: > * simply switch log4j loggers with slf4j logger (done in patch) > * replacing log4j-isms (e.g. string concatenation+isFooEnabled in all code paths) with slf4j-isms (marker string + additional arguments) > * remove code that is already available for lsf4j (LogUtils.java, I believe is unnecessary) > I am posting this as a reminder, I have a half baked patch locally but it needs more work -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.