[jira] [Created] (S2GRAPH-117) Cleaner logging library usage

2016-10-07 Thread Jong Wook Kim (JIRA)
Jong Wook Kim created S2GRAPH-117:
-

 Summary: Cleaner logging library usage
 Key: S2GRAPH-117
 URL: https://issues.apache.org/jira/browse/S2GRAPH-117
 Project: S2Graph
  Issue Type: Improvement
Reporter: Jong Wook Kim


Our SBT project is currently dependent on both log4j and logback, while using 
two logging backends is not ideal.

Furthermore, there has been report that in some configuration we have both 
slf4j-log4j12 and log4j-over-slf4j in the classpath which leads to 
StackOverflowError.

The current codebase is not written with a clean usage of logging library in 
mind, and I propose the following improvements to make our logging usage 
conform with the de-facto standard of slf4j.

- Figure out how the dependencies are using slf4j, log4j, and logback.
- Use slf4j-api everywhere, named with the fully qualified class names.
- Exclude slf4j backends from the library projects
- Add either log4j or logback backends to the application projects, preferably 
log4j.
- Add a test case checking that the classpath has the correct configuration of 
jars.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: [VOTE] Apache S2Graph(incubating) 0.1.0 release RC5

2016-10-07 Thread daewon
-1 (non-binding)

>From hsleep's advice
I added lines below for exclude sl4j and it works.

but I don't know what is right way to solve this issue.

 # s2core/build.sbt
```
.map { moduleId =>
  moduleId.exclude("org.mortbay.jetty", "*").exclude("javax.servlet", "*")
.exclude("org.slf4j", "slf4j-log4j12").exclude("org.slf4j",
"slf4j-jdk14")
}
```
# s2core/build.sbt
libraryDependencies ++= Seq(
  "ch.qos.logback" % "logback-classic" % "1.1.2",
  "com.typesafe" % "config" % "1.2.1",
  "com.typesafe.play" %% "play-json" % Common.playVersion,
  "com.typesafe.akka" %% "akka-actor" % "2.3.4",
  "com.typesafe.akka" %% "akka-slf4j" % "2.3.4",
  "org.apache.hbase" % "hbase-client" % Common.hbaseVersion,
  "org.apache.hbase" % "hbase-common" % Common.hbaseVersion,
  "org.apache.hbase" % "hbase-server" % Common.hbaseVersion,
  "org.apache.hadoop" % "hadoop-common" % Common.hadoopVersion,
  "org.apache.hadoop" % "hadoop-hdfs" % Common.hadoopVersion,
  "commons-pool" % "commons-pool" % "1.6",
  "org.scalatest" %% "scalatest" % "2.2.4" % "test",
  "org.scalikejdbc" %% "scalikejdbc" % "2.1.+",
  "mysql" % "mysql-connector-java" % "5.1.28",
  "org.apache.kafka" % "kafka-clients" % "0.8.2.1",
  "com.github.danielwegener" % "logback-kafka-appender" % "0.0.4",
  "org.apache.tinkerpop" % "gremlin-core" % "3.2.1",
  "org.apache.tinkerpop" % "tinkergraph-gremlin" % "3.2.1",
  "org.apache.tinkerpop" % "gremlin-groovy" % "3.2.1",
  "org.apache.tinkerpop" % "gremlin-test" % "3.2.1",
  "commons-cli" % "commons-cli" % "1.3.1"
).map { moduleId =>
  moduleId.exclude("org.mortbay.jetty", "*").exclude("javax.servlet", "*")
.exclude("org.slf4j", "slf4j-log4j12").exclude("org.slf4j",
"slf4j-jdk14")
}


On Fri, Oct 7, 2016 at 5:01 AM Jong Wook Kim  wrote:

> Let me cast a
>
> +0 (non-binding)
>
>
> 1. we messed up the logging facade.
>
> slf4j-log4j12.jar and log4j-over-slf4j.jar being present in the same
> classpath is a serious problem, and we also have logback-classic with this.
>
> For anyone not familiar with how SLF4j bridges work, I encourage to refer
> to: http://slf4j.org/legacy.html 
>
> It is ideal for us to use only one of log4j or logback, but we are using
> the both. (there are 2 logback.xml and 3 log4j.properties in the tree)
>
> I suppose that using log4j should be better for us, not because logback’s
> functionality is worse but because that’s what other Apache projects are
> doing.
>
> Currently asynchbase and playframework are the two non-Apache depenencies
> that pulls logback (it’s stupid that they have it as compile dependency),
>
> and we need to carefully exclude logback from each of our subprojects and
> move logback settings xml to log4j.properties.
>
> We might still have a valid reason to logback in our play apps, because
> Play! directly uses some of logback’s API besides slf4j.
>
> In that cases we could diverge from other Apache projects and use Logback
> altogether, but the important thing is to use only one of those and not to
> mix up the SLF4j bridges.
>
>
> 2. sbt “project loader” test:compile still fails, and it’s not caught
> during sbt test because the loader project is not included in the main
> aggregate.
>
>
> I guess neither of these are critical for the 0.1.0 release, but I would
> like to know what others think.
>
>
> JW
>
> > On Oct 5, 2016, at 10:47 AM, daewon  wrote:
> >
> > -1 (non-binding)
> >
> > i tried rc5 and it fail.
> >
> > Evn info
> > ```
> > openjdk version "1.8.0_91"
> > OpenJDK Runtime Environment (build
> 1.8.0_91-8u91-b14-0ubuntu4~16.04.1-b14)
> > OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
> >
> > ubuntu/stretch/sid
> > ```
> >
> >
> >
> > root@91720ba55598
> :/apps/apache-s2graph-0.1.0-incubating-src/target/apache-s2graph-0.1.0-incubating-bin/logs#
> > tail -f s2rest_play.log
> >at
> play.core.StaticApplication.(ApplicationProvider.scala:53)
> >at
> play.core.server.NettyServer$.createServer(NettyServer.scala:253)
> >at
> > play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:289)
> >at
> > play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:284)
> >at scala.Option.map(Option.scala:146)
> >at play.core.server.NettyServer$.main(NettyServer.scala:284)
> >at play.core.server.NettyServer.main(NettyServer.scala)
> > Caused by: java.lang.IllegalStateException: Detected both
> > log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting
> > StackOverflowError. See also
> > http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
> >at
> > org.apache.log4j.Log4jLoggerFactory.(Log4jLoggerFactory.java:51)
> >... 14 more
> >
> >
> > On Tue, Oct 4, 2016 at 2:11 PM DO YUNG YOON  wrote:
> >
> >> +1 (non-binding)
> >>
> >> I tried RC5 on ubuntu 16.04, SBT 0.13.9, SCALA 2.11.7, OpenJDK 1.8.0_91.
> >>
> >> Checked followings.
> >>
> >> 1. Checksums and PGP