Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0584510E55 for ; Wed, 26 Nov 2014 19:25:13 +0000 (UTC) Received: (qmail 70681 invoked by uid 500); 26 Nov 2014 19:25:12 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 70647 invoked by uid 500); 26 Nov 2014 19:25:12 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 70636 invoked by uid 99); 26 Nov 2014 19:25:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Nov 2014 19:25:12 +0000 Date: Wed, 26 Nov 2014 19:25:12 +0000 (UTC) From: "Matt Brown (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CASSANDRA-8379) Remove filename and line number flags from default logging configuration MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Matt Brown created CASSANDRA-8379: ------------------------------------- Summary: Remove filename and line number flags from default logging configuration Key: CASSANDRA-8379 URL: https://issues.apache.org/jira/browse/CASSANDRA-8379 Project: Cassandra Issue Type: Improvement Reporter: Matt Brown Priority: Minor n the logging configuration that ships with the cassandra distribution (log4j-server.properties in 2.0, and logback.xml in 2.1), the rolling file appender is configured to print the file name and the line number of each logging event: {code}log4j.appender.R.layout.ConversionPattern=%5p [%t] %d{ISO8601} %F (line %L) %m%n{code} Both the log4j and logback documentation warn that generating the filename/line information is not a cheap operation. >From the [log4j docs|http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html]: > WARNING Generating caller location information is extremely slow and should be avoided unless execution speed is not an issue. >From [logback docs|http://logback.qos.ch/manual/layouts.html]: > Generating the file information is not particularly fast. Thus, its use should be avoided unless execution speed is not an issue. The implementation for both involves creating a new Throwable and then printing the stack trace for the throwable to find the file name or line number. I don't have data to back this up but the conventional advice that "throwing exceptions is slow" has to do with filling in the stacktrace. It would make more sense for the logging configuration to simply use the logger/category name (%c) instead of the file name and to remove the line number part. -- This message was sent by Atlassian JIRA (v6.3.4#6332)