Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 77E15200CE7 for ; Fri, 1 Sep 2017 19:44:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7647E16C5CD; Fri, 1 Sep 2017 17:44:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 93D6016C5F3 for ; Fri, 1 Sep 2017 19:44:05 +0200 (CEST) Received: (qmail 4952 invoked by uid 500); 1 Sep 2017 17:44:04 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 4939 invoked by uid 99); 1 Sep 2017 17:44:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Sep 2017 17:44:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 92719183B72 for ; Fri, 1 Sep 2017 17:44:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.479 X-Spam-Level: ** X-Spam-Status: No, score=2.479 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gridgain-com.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 1BLF3W_yENQu for ; Fri, 1 Sep 2017 17:43:58 +0000 (UTC) Received: from mail-oi0-f49.google.com (mail-oi0-f49.google.com [209.85.218.49]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 407745FBEA for ; Fri, 1 Sep 2017 17:43:57 +0000 (UTC) Received: by mail-oi0-f49.google.com with SMTP id n18so7558932oig.2 for ; Fri, 01 Sep 2017 10:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gridgain-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=BPI7grS7q/j11lGxeASg6aUK3lLU70GAyTf096k34WE=; b=UEeAmoRix+gDR8rJAJG14lX5a+VRxWLjuW81ERNXA/HZK+N7aAFu48t94V1KDuuAb6 wK4Q7aT2ULATGpIUNmWa6vivzKU//VKbgQWr1VAiDno0G4S8JtfJ/77eJ9X/SUptlJCN 1jLClQV9uZDOr/PLsCyFEMDKjWcm7YKRpGjQz3lIhjIvhK0tkx8gIawyStOmi9iaKm/A /uUBmMxCgEjpwFrQwrTc8W2ZPvR35MSNiP/YXQgmTy+VjrcuB0YvpPKBAiaudPsvI7tO sb8dVuyX73X4+QKJrptynsKDSmKM3rGlqHxTiU0WvLpVFxWfJQq3j7mCf/k0oceLB6Tp Cf5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=BPI7grS7q/j11lGxeASg6aUK3lLU70GAyTf096k34WE=; b=nDT9jf5FemSQrGU0x1VWWW+tZLqQvPmRzGGOJiyOkRPePq6LvxY6jjjyAeggF/+e1U jw2UMBc0+IxG4QZXZi7TPuiF5ndKWst8QAqYgTJEFEAjjk8Z2Tb5HKvKIgJ6pGWdZ8qm nwtzYzpSBdalMctEKKSlRK0ZEBe4WxDWX7V0lXjTtqIL7e6d7gGf1bUwkjx9HKjVU3ng Wr4OtYn2CFBi+Mz1atP4lz3rMhYYSylh+ErWsrPWlAnl+/is5So+EoGD2+G5TdWnv636 sXJIoka5erc0uuRp0E7q3G+RZlIsZOhw+vhaq5C8JVPSpB5G8HAYQvC5xiCWITsYSTR3 vAug== X-Gm-Message-State: AHPjjUjc6D8tg892UhvDG+WE0eeUIxwu89MSm8mjuc6Gk4Jrmcn3vyNm 5tmLxMcR6kj3pboWr5h6sFD3kqu/YvEfa0c= X-Google-Smtp-Source: ADKCNb5bnN76QLmB7Xqb8S3lj3BkzrnMBwcCJOUWJNqqcGlPq38MfeqgaUa8osN+IxQEteApnRz+VL5tu8h+rotUZYs= X-Received: by 10.202.85.19 with SMTP id j19mr2677466oib.193.1504287835594; Fri, 01 Sep 2017 10:43:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.9.139 with HTTP; Fri, 1 Sep 2017 10:43:25 -0700 (PDT) In-Reply-To: References: From: Prachi Garg Date: Fri, 1 Sep 2017 10:43:25 -0700 Message-ID: Subject: Re: How to configure ignite-jcl and Ignite-slf4j logger To: dev@ignite.apache.org Cc: Valentin Kulichenko , Denis Magda Content-Type: multipart/alternative; boundary="001a113d2bc014ba200558244e32" archived-at: Fri, 01 Sep 2017 17:44:06 -0000 --001a113d2bc014ba200558244e32 Content-Type: text/plain; charset="UTF-8" Nikolai, I have specified 'gridlogger' property in 'IgniteConfiguration', but looks like it does not get instantiated. ... On Fri, Sep 1, 2017 at 10:16 AM, Nikolay Tikhonov wrote: > Hi Denis, > > JCL it's wrapper for logging system (similar sl4j) which can be used > together with log4j. I guess that JavaDoc correct. > > On Fri, Sep 1, 2017 at 5:40 PM, Denis Magda wrote: > > > Nikolai, > > > > Looking at JCL documentation I see the usage of Log4j together with JCL: > > > > *
> > *      ...
> > *      <property name="gridLogger">
> > *          <bean class="org.apache.ignite.logger.jcl.JclLogger">
> > *              <constructor-arg type="org.apache.commons.
> > logging.Log">
> > *                  <bean class="org.apache.commons.
> > logging.impl.Log4JLogger">
> > *                      <constructor-arg type="java.lang.String"
> > value="config/ignite-log4j.xml"/>
> > *                  </bean>
> > *              </constructor-arg>
> > *          </bean>
> > *      </property>
> > *      ...
> > * 
> > > > > > or > > > > * And the same configuration if you'd like to configure Ignite in your > > code: > > *
> > *      IgniteConfiguration cfg = new IgniteConfiguration();
> > *      ...
> > *      IgniteLogger log = new JclLogger(new Log4JLogger("config/ignite-
> > log4j.xml"));
> > *      ...
> > *      cfg.setGridLogger(log);
> > * 
> > > > > > Is it wrong? Could you fix the Java Doc in a proper way? > > > > > > > On Sep 1, 2017, at 3:12 AM, Nikolai Tikhonov > > wrote: > > > > > > Hello Prachi! > > > > > > You need to set gridLogger property in IgniteConfiguration and remove > > ignite-log4j dependency from POM file. > > > > > > For example for Sl4j logger: > > > > > > igniteConfiguration.setGridLogger(new Slf4jLogger()); > > > > > > and for Jc logger: > > > > > > igniteConfiguration.setGridLogger(new JclLogger()); > > > > > > On Fri, Sep 1, 2017 at 2:44 AM, Prachi Garg > pgarg@gridgain.com>> wrote: > > > Engineers, > > > > > > In the attempt to document loggers supported by Ignite, I am having a > > hard > > > time configuring ignite-jcl and ignite-slf4j (I could configure log4j > and > > > log4j2). I don't see the log message on my console when I use > ignite-jcl > > or > > > ignite-slf4j. > > > > > > Below is the configuration and sample code I am using: > > > > > > *ignite-log4j.xml* > > > > > > > > > > > xmlns:log4j='http://jakarta.apache.org/log4j/ < > > http://jakarta.apache.org/log4j/>'> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > *Maven dependency -* > > > > > > > > > org.apache.ignite > > > ignite-log4j > > > 2.1.0 > > > > > > > > > > > > org.apache.ignite > > > ignite-jcl > > > 2.1.0 > > > > > > > > > > > > *Configuration for JCL ( as specified in javadoc)- * > > > > > > > > > > > > > > > > > > > > value="/Users/prachig/myexamples/config/ignite-log4j.xml"/> > > > > > > > > > > > > > > > > > > > > > *Sample code I am using- * > > > > > > public class LoggerExample { > > > public static void main(String[] args) throws IgniteException { > > > try (Ignite ignite = > > > Ignition.start("/Users/prachig/myexamples/config/cluster-config.xml")) > > > { > > > ignite.log().info("Info Message 1 Logged !!!"); > > > ignite.log().info("Info Message 2 Logged !!!"); > > > > > > System.out.println(ignite.log().getClass()); > > > } > > > } > > > } > > > > > > *Output* > > > > > > /Library/Java/JavaVirtualMachines/jdk1.8.0_ > 74.jdk/Contents/Home/bin/java > > > -Didea.launcher.port=7535 > > > "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA > > > CE.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath > > > "/Library/Java/JavaVirtualMachines/jdk1.8.0_ > > 74.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/ > > JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/ > > deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_ > > 74.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/ > > Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/ > > lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1. > > 8.0_74.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/ > > Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/ > > lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1. > > 8.0_74.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/ > > JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/ > > ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_ > > 74.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/ > > JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/ > > ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_ > > 74.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/ > > Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/ > > lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1. > > 8.0_74.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/ > > JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/ > > jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_ > > 74.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/ > > JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/ > > jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_ > > 74.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/ > > JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/ > > management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1. > > 8.0_74.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/ > > JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/ > > resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_ > > 74.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/ > > JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/lib/ant- > > javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_ > > 74.jdk/Contents/Home/lib/dt.jar:/Library/Java/ > > JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/lib/ > > javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_ > > 74.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/ > > JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/lib/ > > packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_ > > 74.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/ > > JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/lib/ > > tools.jar:/Users/prachig/myexamples/target/classes:/ > > Users/prachig/.m2/repository/org/apache/ignite/ignite-core/ > > 2.1.0/ignite-core-2.1.0.jar:/Users/prachig/.m2/repository/ > > javax/cache/cache-api/1.0.0/cache-api-1.0.0.jar:/Users/ > > prachig/.m2/repository/org/jetbrains/annotations/13.0/ > > annotations-13.0.jar:/Users/prachig/.m2/repository/org/ > > gridgain/ignite-shmem/1.0.0/ignite-shmem-1.0.0.jar:/Users/ > > prachig/.m2/repository/org/apache/ignite/ignite-spring/2. > > 1.0/ignite-spring-2.1.0.jar:/Users/prachig/.m2/repository/ > > org/apache/ignite/ignite-indexing/2.1.0/ignite- > indexing-2.1.0.jar:/Users/ > > prachig/.m2/repository/commons-codec/commons-codec/1. > > 6/commons-codec-1.6.jar:/Users/prachig/.m2/repository/ > > org/apache/lucene/lucene-core/5.5.2/lucene-core-5.5.2.jar:/ > > Users/prachig/.m2/repository/org/apache/lucene/lucene- > > analyzers-common/5.5.2/lucene-analyzers-common-5.5.2.jar:/ > > Users/prachig/.m2/repository/org/apache/lucene/lucene- > > queryparser/5.5.2/lucene-queryparser-5.5.2.jar:/Users/ > > prachig/.m2/repository/org/apache/lucene/lucene-queries/ > > 5.5.2/lucene-queries-5.5.2.jar:/Users/prachig/.m2/ > > repository/org/apache/lucene/lucene-sandbox/5.5.2/lucene- > > sandbox-5.5.2.jar:/Users/prachig/.m2/repository/com/ > > h2database/h2/1.4.195/h2-1.4.195.jar:/Users/prachig/.m2/repository/org/ > > springframework/spring-core/4.3.7.RELEASE/spring-core-4.3.7. > > RELEASE.jar:/Users/prachig/.m2/repository/commons-logging/ > > commons-logging/1.1.1/commons-logging-1.1.1.jar:/Users/ > > prachig/.m2/repository/org/springframework/spring-aop/4. > > 3.7.RELEASE/spring-aop-4.3.7.RELEASE.jar:/Users/prachig/. > > m2/repository/org/springframework/spring-beans/ > > 4.3.7.RELEASE/spring-beans-4.3.7.RELEASE.jar:/Users/ > > prachig/.m2/repository/org/springframework/spring- > > context/4.3.7.RELEASE/spring-context-4.3.7.RELEASE.jar:/ > > Users/prachig/.m2/repository/org/springframework/spring- > > expression/4.3.7.RELEASE/spring-expression-4.3.7. > > RELEASE.jar:/Users/prachig/.m2/repository/org/ > > springframework/spring-tx/4.3.7.RELEASE/spring-tx-4.3.7. > > RELEASE.jar:/Users/prachig/.m2/repository/org/ > > springframework/spring-jdbc/4.3.7.RELEASE/spring-jdbc-4.3.7. > > RELEASE.jar:/Users/prachig/.m2/repository/org/apache/ > > ignite/ignite-log4j2/2.1.0/ignite-log4j2-2.1.0.jar:/ > > Users/prachig/.m2/repository/org/apache/logging/log4j/ > > log4j-api/2.8.1/log4j-api-2.8.1.jar:/Users/prachig/.m2/ > > repository/org/apache/logging/log4j/log4j-core/2.8.1/log4j- > > core-2.8.1.jar:/Users/prachig/.m2/repository/org/apache/ > > ignite/ignite-log4j/2.1.0/ignite-log4j-2.1.0.jar:/Users/ > > prachig/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar: > > /Users/prachig/.m2/repository/org/apache/ignite/ignite-jcl/ > > 2.1.0/ignite-jcl-2.1.0.jar:/Users/prachig/.m2/repository/ > > org/apache/ignite/ignite-slf4j/2.1.0/ignite-slf4j-2.1. > > 0.jar:/Users/prachig/.m2/repository/org/slf4j/slf4j- > > api/1.7.7/slf4j-api-1.7.7.jar:/Users/prachig/.m2/repository/ > > mysql/mysql-connector-java/5.1.6/mysql-connector-java-5.1. > > 6.jar:/Users/prachig/.m2/repository/net/spy/spymemcached/2.11.7/ > > spymemcached-2.11.7.jar:/Applications/IntelliJ > > > IDEA CE.app/Contents/lib/idea_rt.jar" > > > com.intellij.rt.execution.application.AppMain > > > ignite.myexamples.LoggerExample > > > log4j:WARN No appenders could be found for logger > > > (org.apache.ignite.internal.util.typedef.G). > > > log4j:WARN Please initialize the log4j system properly. > > > log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig < > > http://logging.apache.org/log4j/1.2/faq.html#noconfig> > > > for more info. > > > [15:59:49] __________ ________________ > > > [15:59:49] / _/ ___/ |/ / _/_ __/ __/ > > > [15:59:49] _/ // (7 7 // / / / / _/ > > > [15:59:49] /___/\___/_/|_/___/ /_/ /___/ > > > [15:59:49] > > > [15:59:49] ver. 2.1.0#20170720-sha1:a6ca5c8a > > > [15:59:49] 2017 Copyright(C) Apache Software Foundation > > > [15:59:49] > > > [15:59:49] Ignite documentation: http://ignite.apache.org < > > http://ignite.apache.org/> > > > [15:59:49] > > > [15:59:49] Quiet mode. > > > [15:59:49] ^-- To see **FULL** console log here add > > > -DIGNITE_QUIET=false or "-v" to ignite.{sh|bat} > > > [15:59:49] > > > [15:59:49] OS: Mac OS X 10.12.1 x86_64 > > > [15:59:49] VM information: Java(TM) SE Runtime Environment > > > 1.8.0_74-b02 Oracle Corporation Java HotSpot(TM) 64-Bit Server VM > > > 25.74-b02 > > > [15:59:49] Initial heap size is 256MB (should be no less than 512MB, > > > use -Xms512m -Xmx512m). > > > [15:59:49] Configured plugins: > > > [15:59:49] ^-- None > > > [15:59:49] > > > [15:59:49] Message queue limit is set to 0 which may lead to potential > > > OOMEs when running cache operations in FULL_ASYNC or PRIMARY_SYNC > > > modes due to message queues growth on sender and receiver sides. > > > [15:59:49] Security status [authentication=off, tls/ssl=off] > > > Aug 31, 2017 3:59:49 PM java.util.logging.LogManager$RootLogger log > > > SEVERE: Failed to resolve default logging config file: > > > config/java.util.logging.properties > > > [15:59:50] Performance suggestions for grid (fix if possible) > > > [15:59:50] To disable, set -DIGNITE_PERFORMANCE_ > > SUGGESTIONS_DISABLED=true > > > [15:59:50] ^-- Enable G1 Garbage Collector (add '-XX:+UseG1GC' to JVM > > options) > > > [15:59:50] ^-- Specify JVM heap max size (add > > > '-Xmx[g|G|m|M|k|K]' to JVM options) > > > [15:59:50] ^-- Set max direct memory size if getting 'OOME: Direct > > > buffer memory' (add '-XX:MaxDirectMemorySize=[g|G|m|M|k|K]' to > > > JVM options) > > > [15:59:50] ^-- Disable processing of calls to System.gc() (add > > > '-XX:+DisableExplicitGC' to JVM options) > > > [15:59:50] Refer to this page for more performance suggestions: > > > https://apacheignite.readme.io/docs/jvm-and-system-tuning < > > https://apacheignite.readme.io/docs/jvm-and-system-tuning> > > > [15:59:50] > > > [15:59:50] To start Console Management & Monitoring run > > ignitevisorcmd.{sh|bat} > > > [15:59:50] > > > [15:59:50] Ignite node started OK (id=fa20d03b) > > > [15:59:50] Topology snapshot [ver=1, servers=1, clients=0, CPUs=4, > > heap=3.6GB] > > > class org.apache.ignite.internal.GridLoggerProxy > > > [15:59:50] Ignite node stopped OK [uptime=00:00:00:085] > > > > > > > > > > > > > > > How can I make it work? > > > > > > -P > > > > > > > > --001a113d2bc014ba200558244e32--