You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Matt Brown (JIRA)" <ji...@apache.org> on 2014/11/26 20:25:12 UTC
[jira] [Created] (CASSANDRA-8379) Remove filename and line number
flags from default logging configuration
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)