You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "gabriele renzi (JIRA)" <ji...@apache.org> on 2009/12/11 08:59:18 UTC

[jira] Created: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

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
    Affects Versions: 0.5
         Environment: all
            Reporter: gabriele renzi
            Priority: Minor


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.


[jira] Issue Comment Edited: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12843147#action_12843147 ] 

Eric Evans edited comment on CASSANDRA-625 at 3/9/10 3:29 PM:
--------------------------------------------------------------

> 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/ ). 

No expert here, but it was my understanding that this was the general reasoning behind slf4j.

      was (Author: urandom):
    > 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/ ). 

No expert here, but it was my understanding that this was the general reasoning for behind slf4j.
  
> 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.


[jira] Resolved: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis resolved CASSANDRA-625.
--------------------------------------

    Resolution: Incomplete

Closing until someone wants to submit a patch.

> 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
>    Affects Versions: 0.5
>         Environment: all
>            Reporter: gabriele renzi
>            Priority: Minor
>
> 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.


[jira] Updated: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "gabriele renzi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

gabriele renzi updated CASSANDRA-625:
-------------------------------------

    Attachment:     (was: CASSANDRA-625.patch)

> 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-3.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.


[jira] Updated: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "gabriele renzi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

gabriele renzi updated CASSANDRA-625:
-------------------------------------

    Attachment:     (was: CASSANDRA-625-3.patch)

> 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-3.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.


[jira] Updated: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "gabriele renzi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

gabriele renzi updated CASSANDRA-625:
-------------------------------------

    Attachment: CASSANDRA-625-3.patch

heck, I can't understand why I'm failing to build this, but this time it should be correct. I'm really sorry for having caused you all a waste of time.

$ svn up
At revision 921255.
f$ svn info
Path: .
URL: http://svn.apache.org/repos/asf/incubator/cassandra/trunk
Repository Root: http://svn.apache.org/repos/asf
Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
Revision: 921255
Node Kind: directory
Schedule: normal
Last Changed Author: eevans
Last Changed Rev: 921220
Last Changed Date: 2010-03-10 04:48:12 +0100 (Wed, 10 Mar 2010)

$ svn diff > CASSANDRA-625-3.patch
$ grep RangeVerb CASSANDRA-625.patch 
$  ok none here...


> 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-3.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.


[jira] Commented: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12843147#action_12843147 ] 

Eric Evans commented on CASSANDRA-625:
--------------------------------------

> 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/ ). 

No expert here, but it was my understanding that this was the general reasoning for behind slf4j.

> 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.


[jira] Commented: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844867#action_12844867 ] 

Hudson commented on CASSANDRA-625:
----------------------------------

Integrated in Cassandra #377 (See [http://hudson.zones.apache.org/hudson/job/Cassandra/377/])
     switch to slf4j logging. Patch by Gabriele Renzi, reviewed by Gary Dusbabek.


> 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-3.patch, CASSANDRA-625-4.patch, CASSANDRA-625-5.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.


[jira] Updated: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "gabriele renzi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

gabriele renzi updated CASSANDRA-625:
-------------------------------------

    Attachment: CASSANDRA-625.patch

switches most classes to slf4j. All tests still passing against r920469

> 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
>    Affects Versions: 0.6
>         Environment: all
>            Reporter: gabriele renzi
>            Priority: Minor
>             Fix For: 0.6
>
>         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.


[jira] Updated: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "gabriele renzi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

gabriele renzi updated CASSANDRA-625:
-------------------------------------

    Attachment: CASSANDRA-625-5.patch
                CASSANDRA-625-4.patch

-4 adds changes to the remaming CassandraDamon and StorageService files,  -5 is rebased against r922168, on y box all tests still passing

> 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-3.patch, CASSANDRA-625-4.patch, CASSANDRA-625-5.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.


[jira] Updated: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "gabriele renzi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

gabriele renzi updated CASSANDRA-625:
-------------------------------------

    Attachment: CASSANDRA-625-3.patch

> 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-3.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.


[jira] Commented: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "gabriele renzi (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12843777#action_12843777 ] 

Gary Dusbabek commented on CASSANDRA-625:
-----------------------------------------

That patch works. :)

Why not have CassandraDaemon and StorageService use the slf4j logger and still call into log4j to make the settings changes?  (Obviously these will be noops when slf4j is not bound to log4j.)  Or is this kind of mixing not allowed?

> 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-3.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.


[jira] Updated: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "gabriele renzi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

gabriele renzi updated CASSANDRA-625:
-------------------------------------

    Attachment: CASSANDRA-625.patch

rebased patch, sorry for the mess on the previous one, it appears I had spurious old files around

> 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, 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.


[jira] Commented: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "gabriele renzi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844400#action_12844400 ] 

gabriele renzi commented on CASSANDRA-625:
------------------------------------------

yes, it's possible, re-attaching patch in a moment, see example:

normal run:
$ ./bin/cassandra -f
 INFO 08:39:45,390 Auto DiskAccessMode determined to be standard
 INFO 08:39:45,692 Sampling index for /var/lib/cassandra/data/system/LocationInfo-b-1-<>
 INFO 08:39:45,707 Sampling index for /var/lib/cassandra/data/system/LocationInfo-b-2-<>
 INFO 08:39:45,724 Replaying /var/lib/cassandra/commitlog/CommitLog-1268379533004.log



move logback jars to build/lib/jars, output is obviously different
$ ./bin/cassandra -f
08:38:52.463 [main] DEBUG o.a.c.config.DatabaseDescriptor - Loading settings from ./bin/../conf/storage-conf.xml
08:38:52.602 [main] DEBUG o.a.c.config.DatabaseDescriptor - Syncing log with a period of 10000
08:38:52.606 [main] INFO  o.a.c.config.DatabaseDescriptor - Auto DiskAccessMode determined to be standard
08:38:52.686 [main] DEBUG o.a.c.config.DatabaseDescriptor - setting autoBootstrap to false
08:38:52.744 [main] DEBUG o.a.cassandra.thrift.CassandraDaemon - opening keyspace Keyspace1
08:38:52.868 [main] DEBUG o.a.cassandra.db.ColumnFamilyStore - Starting CFS Super1
....

now creating a logback configuration equals to log4j's 
$ cat >> logback.xml
<?xml version="1.0" encoding="UTF-8"?>

<configuration>
  <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
    <layout class="ch.qos.logback.classic.PatternLayout">
      <Pattern>%5p %d{HH:mm:ss,SSS} %m%n</Pattern>
    </layout>
  </appender>
  <appender name="R" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <!--See also http://logback.qos.ch/manual/appenders.html#RollingFileAppender-->
    <File>/var/log/cassandra/system.log</File>
    <layout class="ch.qos.logback.classic.PatternLayout">
      <Pattern>%5p [%t] %d{ISO8601} %F (line %L) %m%n</Pattern>
    </layout>
    <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"/>
    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"/>
  </appender>
  <root level="INFO">
    <appender-ref ref="stdout"/>
    <appender-ref ref="R"/>
  </root>
</configuration>

$ ./bin/cassandra -f
 INFO 08:40:59,737 Auto DiskAccessMode determined to be standard
 INFO 08:40:59,979 Sampling index for /var/lib/cassandra/data/system/LocationInfo-b-1-<>
 INFO 08:40:59,993 Sampling index for /var/lib/cassandra/data/system/LocationInfo-b-2-<>
 INFO 08:40:59,995 Sampling index for /var/lib/cassandra/data/system/LocationInfo-b-3-<>
 INFO 08:41:00,012 Replaying /var/lib/cassandra/commitlog/CommitLog-1268379585778.log

it works :)


> 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-3.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.


[jira] Commented: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12843049#action_12843049 ] 

Gary Dusbabek commented on CASSANDRA-625:
-----------------------------------------

I get a lot of conflicts when applying this patch (to trunk, 0.6 or just about anywhere else).  I made sure to sync back to r920469.  I notice that it contains references to files that are no longer present (SelectorManager, TcpConnection and others), and many of the diffs are generated from older versions of the files.  How much work to clean things up so it applies cleanly to the trunk?

> 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.


[jira] Reopened: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "gabriele renzi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

gabriele renzi reopened CASSANDRA-625:
--------------------------------------


adding patch

> 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
>    Affects Versions: 0.5
>         Environment: all
>            Reporter: gabriele renzi
>            Priority: Minor
>
> 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.


[jira] Commented: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12843346#action_12843346 ] 

Jonathan Ellis commented on CASSANDRA-625:
------------------------------------------

the only place we can apply this is trunk (hence my change of fix-version to 0.7), and the latest patch doesn't apply there.  I'm seeing RangeVerbHandler.java in there for instance when I think we took out way back in 0.6.  Certainly it doesn't exist anymore in trunk. :)

> 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, 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.


[jira] Updated: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-625:
-------------------------------------

    Affects Version/s:     (was: 0.6)
        Fix Version/s:     (was: 0.6)
                       0.7

> 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.


[jira] Commented: (CASSANDRA-625) Migrate to slf4j from log4j in cassandra code

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12842848#action_12842848 ] 

Gary Dusbabek commented on CASSANDRA-625:
-----------------------------------------

Gabriele, does slf4j add any performance benefit to cassandra, or improve the logging in a dramatic way?  I'm just trying to understand the motivation for such a change.  To me "because thrift uses slf4j" is not compelling enough.  :)

> 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
>    Affects Versions: 0.6
>         Environment: all
>            Reporter: gabriele renzi
>            Priority: Minor
>             Fix For: 0.6
>
>         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.