You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Jonathon Bell <jo...@gmail.com> on 2015/06/12 22:04:24 UTC

logging

Hi all,

My application uses SLF4J and LOGBACK for logging.
Is it possible for me to configure the ignite libraries to use this logging
combination too? If so, how?

n.b: i tried adding the  line:

         <groupId>org.apache.ignite</groupId>

         <artifactId>ignite-slf4j</artifactId>

         <version>1.1.0-incubating</version>
to my pom, but still see:

Jun 12, 2015 3:59:12 PM java.util.logging.LogManager$RootLogger log

SEVERE: Failed to resolve default logging config file:
config/java.util.logging.properties

[15:59:12]    __________  ________________

[15:59:12]   /  _/ ___/ |/ /  _/_  __/ __/

[15:59:12]  _/ // (7 7    // /  / / / _/

[15:59:12] /___/\___/_/|_/___/ /_/ /___/

[15:59:12]

[15:59:12] ver. 1.1.0-incubating#20150520-sha1:6da491f4

[15:59:12] 2015 Copyright(C) Apache Software Foundation

[15:59:12]
....

when starting up my application...

Regards,

Jonathon

Re: logging

Posted by jonathon <jo...@gmail.com>.
Thank you, Val.

I'm still a little confused though. I wish to:

1) Instantiate my own LogBack logger "LB":

   org.slf4j.Logger LB = org.slf4j.LoggerFactory.getLogger("jonathon"); 

2) Start an ignite grid by specifying a Spring XML file:

   Ignite ignite = Ignition.start("ignite.xml");

3) Specify that my new grid use the log LB.

It seems that i can either:

a) Create an IgniteConfiguration, and set LB into it:

   IgniteConfiguration cfg = new IgniteConfiguration();
   cfg.setLogger(new Slf4jLogger(LB));
   Ignition.start(cfg);

   But how then do i then load in my XML file? I see now IgniteCOnfiguration
constructor or method that allows me to supply the path to the Spring XML
file.

b) Specify that ignite uses a Sl4J logger in the Spring XML file:

      <property name="gridLogger">
         <bean class="org.apache.ignite.logger.slf4j.Slf4jLogger"/>
      </property>

    But then how do i connect this default constructed Slf4jLogger bean to
my own logger LB?

Hoping you can help me...

Jonathon






--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/logging-tp480p627.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: logging

Posted by Valentin Kulichenko <va...@gmail.com>.
Jonathon,

You should also configure SLF4J logger in configuration:

Slf4jLogger gridLog = new Slf4jLogger(slf4jLog); // Provide correct SLF4J
logger here.

igniteCfg.setGridLogger(gridLog);

Let us know if it helps.

-Val

On Fri, Jun 12, 2015 at 1:04 PM, Jonathon Bell <jo...@gmail.com>
wrote:

> Hi all,
>
> My application uses SLF4J and LOGBACK for logging.
> Is it possible for me to configure the ignite libraries to use this
> logging combination too? If so, how?
>
> n.b: i tried adding the  line:
>
>          <groupId>org.apache.ignite</groupId>
>
>          <artifactId>ignite-slf4j</artifactId>
>
>          <version>1.1.0-incubating</version>
> to my pom, but still see:
>
> Jun 12, 2015 3:59:12 PM java.util.logging.LogManager$RootLogger log
>
> SEVERE: Failed to resolve default logging config file:
> config/java.util.logging.properties
>
> [15:59:12]    __________  ________________
>
> [15:59:12]   /  _/ ___/ |/ /  _/_  __/ __/
>
> [15:59:12]  _/ // (7 7    // /  / / / _/
>
> [15:59:12] /___/\___/_/|_/___/ /_/ /___/
>
> [15:59:12]
>
> [15:59:12] ver. 1.1.0-incubating#20150520-sha1:6da491f4
>
> [15:59:12] 2015 Copyright(C) Apache Software Foundation
>
> [15:59:12]
> ....
>
> when starting up my application...
>
> Regards,
>
> Jonathon
>
>

Re: logging

Posted by Jonathon Bell <jo...@gmail.com>.
Yes, thanks, exactly what I needed. j

> On Jun 12, 2015, at 10:06 PM, Valentin Kulichenko <va...@gmail.com> wrote:
> 
> Jonathon,
> 
> IgniteMessaging facade can be created for a cluster group (see message(ClusterGroup grp) method). So you can create a cluster group with only one receiver node and create IgniteMessaging instance for this group. All messages sent through this instance will be sent to that node only. The receiver node should have a listener for correct topic, of course.
> 
> Is this what you're looking for?
> 
> -Val
> 
>> On Fri, Jun 12, 2015 at 3:00 PM, Jonathon Bell <jo...@gmail.com> wrote:
>> Hi All,
>> 
>> I have a question about the way the publish-subscribe topic based messaging system is implemented in ignite.
>> 
>> I wish to send a large number of messages to n different tasks, each potentially running on its own node. When sending each message, i know the exact unique task that should receive it (so perhaps what i really want is a peer-to-peer model?). It occurs to me that i can achieve this effect by establishing a distinct topic for each of the n receiving tasks, and have the reciting task listening on its very own topic.
>> 
>> Will this approach scale? Is it reasonably efficient? May i assume that a message M published for topic T is only transmitted across the network to those nodes that have ​expressed interest in topic T (which in my case would be just one node)? 
>> 
>> If not, can i achieve what i want by somehow assigning each receiving task to a separate cluster group?
>> 
>> Many thanks,
>> 
>> Jonathon 
> 

Re: logging

Posted by Valentin Kulichenko <va...@gmail.com>.
Jonathon,

IgniteMessaging facade can be created for a cluster group
(see message(ClusterGroup grp) method). So you can create a cluster group
with only one receiver node and create IgniteMessaging instance for this
group. All messages sent through this instance will be sent to that node
only. The receiver node should have a listener for correct topic, of course.

Is this what you're looking for?

-Val

On Fri, Jun 12, 2015 at 3:00 PM, Jonathon Bell <jo...@gmail.com>
wrote:

> Hi All,
>
> I have a question about the way the publish-subscribe topic based
> messaging system is implemented in ignite.
>
> I wish to send a large number of messages to *n *different tasks, each
> potentially running on its own node. When sending each message, i know the
> exact unique task that should receive it (so perhaps what i really want is
> a peer-to-peer model?). It occurs to me that i can achieve this effect by
> establishing a distinct topic for each of the *n* receiving tasks, and
> have the reciting task listening on its very own topic.
>
> Will this approach scale? Is it reasonably efficient? May i assume that a
> message M published for topic T is only transmitted across the network to
> those nodes that have ​expressed interest in topic T (which in my case
> would be just one node)?
>
> If not, can i achieve what i want by somehow assigning each receiving task
> to a separate cluster group?
>
> Many thanks,
>
> Jonathon
>

Re: logging

Posted by Jonathon Bell <jo...@gmail.com>.
Hi All,

I have a question about the way the publish-subscribe topic based messaging
system is implemented in ignite.

I wish to send a large number of messages to *n *different tasks, each
potentially running on its own node. When sending each message, i know the
exact unique task that should receive it (so perhaps what i really want is
a peer-to-peer model?). It occurs to me that i can achieve this effect by
establishing a distinct topic for each of the *n* receiving tasks, and have
the reciting task listening on its very own topic.

Will this approach scale? Is it reasonably efficient? May i assume that a
message M published for topic T is only transmitted across the network to
those nodes that have ​expressed interest in topic T (which in my case
would be just one node)?

If not, can i achieve what i want by somehow assigning each receiving task
to a separate cluster group?

Many thanks,

Jonathon