[infinispan-dev] cache name in logs

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

[infinispan-dev] cache name in logs

Mircea Markus
Hi,

I'm looking into some logs for the a JBW demo : it has 4 caches deployed on each node and lots of topology changes happen. It's close to impossible to tell  which log pertains to which cache, especially around the DistributionInterceptorImpl.
Wouldn't it make sense that, for certain components, to include the name of the cache in the logs? IThis might be achieved with minimal changes by adding an additional param to the LogFactory.getLog(Class) method and let the logger itself do the heavy lifting.
e.g.
Log l = LogFactory.getLog(DistributionManagerImpl.class, "cacheName");
and on each call l.trace("A message") the logger might output, besides underlying log's format, the string "[cacheName] A message".

Wdyt?
Cheers,
Mircea
_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] cache name in logs

Olaf Bergner
Am 27.04.11 16:55, schrieb Mircea Markus:
> Hi,
>
> I'm looking into some logs for the a JBW demo : it has 4 caches deployed on each node and lots of topology changes happen. It's close to impossible to tell  which log pertains to which cache, especially around the DistributionInterceptorImpl.
> Wouldn't it make sense that, for certain components, to include the name of the cache in the logs? IThis might be achieved with minimal changes by adding an additional param to the LogFactory.getLog(Class) method and let the logger itself do the heavy lifting.
> e.g.
> Log l = LogFactory.getLog(DistributionManagerImpl.class, "cacheName");
> and on each call l.trace("A message") the logger might output, besides underlying log's format, the string "[cacheName] A message".
>
I would prefer a largely transparent mechanism base on MDC[1], yet it
seems as if Inifispan's own log abstraction does not support this.

Which in turn leads me to a question I wanted to ask anyway. Why does
Infinispan have its own logging abstraction when there is jboss logging?
> Wdyt?
> Cheers,
> Mircea
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>

_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] cache name in logs

Olaf Bergner
In reply to this post by Mircea Markus
Silly me, forgot the link: http://logback.qos.ch/manual/mdc.html.

Am 27.04.11 16:55, schrieb Mircea Markus:

> Hi,
>
> I'm looking into some logs for the a JBW demo : it has 4 caches deployed on each node and lots of topology changes happen. It's close to impossible to tell  which log pertains to which cache, especially around the DistributionInterceptorImpl.
> Wouldn't it make sense that, for certain components, to include the name of the cache in the logs? IThis might be achieved with minimal changes by adding an additional param to the LogFactory.getLog(Class) method and let the logger itself do the heavy lifting.
> e.g.
> Log l = LogFactory.getLog(DistributionManagerImpl.class, "cacheName");
> and on each call l.trace("A message") the logger might output, besides underlying log's format, the string "[cacheName] A message".
>
> Wdyt?
> Cheers,
> Mircea
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>

_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] cache name in logs

Manik Surtani
We do now support JBoss Logging.


@Galder, does JBoss Logging have support for what Mircea mentioned below?

On 27 Apr 2011, at 13:21, Olaf Bergner wrote:

Silly me, forgot the link: http://logback.qos.ch/manual/mdc.html.

Am 27.04.11 16:55, schrieb Mircea Markus:
Hi,

I'm looking into some logs for the a JBW demo : it has 4 caches deployed on each node and lots of topology changes happen. It's close to impossible to tell  which log pertains to which cache, especially around the DistributionInterceptorImpl.
Wouldn't it make sense that, for certain components, to include the name of the cache in the logs? IThis might be achieved with minimal changes by adding an additional param to the LogFactory.getLog(Class) method and let the logger itself do the heavy lifting.
e.g.
Log l = LogFactory.getLog(DistributionManagerImpl.class, "cacheName");
and on each call l.trace("A message") the logger might output, besides underlying log's format, the string "[cacheName] A message".

Wdyt?
Cheers,
Mircea
_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev



_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] cache name in logs

Galder Zamarreno

On Apr 28, 2011, at 11:47 PM, Manik Surtani wrote:

> We do now support JBoss Logging.
>
> https://issues.jboss.org/browse/ISPN-380
>
> @Galder, does JBoss Logging have support for what Mircea mentioned below?

I've skimmed through the javadoc but didn't see anything in particular for this at least around the message loggers which are the ones that help with internationalization.

I think it could be fitted but would require a fair amount of changes, such as making some static loggers, particularly those for named cache components non static in order to take the cache name. Maybe you could have a named cache component for a log factory?

The other potential can of worms here is when multiple cache managers are in action (i.e. managed environments) and you have multiple cache managers with same cache names. You could end up having to put cache manager as well and this could get too verbose. It could maybe be configurable somehow.

David, any other ideas?

>
> On 27 Apr 2011, at 13:21, Olaf Bergner wrote:
>
>> Silly me, forgot the link: http://logback.qos.ch/manual/mdc.html.
>>
>> Am 27.04.11 16:55, schrieb Mircea Markus:
>>> Hi,
>>>
>>> I'm looking into some logs for the a JBW demo : it has 4 caches deployed on each node and lots of topology changes happen. It's close to impossible to tell  which log pertains to which cache, especially around the DistributionInterceptorImpl.
>>> Wouldn't it make sense that, for certain components, to include the name of the cache in the logs? IThis might be achieved with minimal changes by adding an additional param to the LogFactory.getLog(Class) method and let the logger itself do the heavy lifting.
>>> e.g.
>>> Log l = LogFactory.getLog(DistributionManagerImpl.class, "cacheName");
>>> and on each call l.trace("A message") the logger might output, besides underlying log's format, the string "[cacheName] A message".
>>>
>>> Wdyt?
>>> Cheers,
>>> Mircea
>>> _______________________________________________
>>> infinispan-dev mailing list
>>> [hidden email]
>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>>
>>
>> _______________________________________________
>> infinispan-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
> --
> Manik Surtani
> [hidden email]
> twitter.com/maniksurtani
>
> Lead, Infinispan
> http://www.infinispan.org
>
>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] cache name in logs

Olaf Bergner
Am 29.04.11 16:55, schrieb Galder Zamarreño:

> On Apr 28, 2011, at 11:47 PM, Manik Surtani wrote:
>
>> We do now support JBoss Logging.
>>
>> https://issues.jboss.org/browse/ISPN-380
>>
>> @Galder, does JBoss Logging have support for what Mircea mentioned below?
> I've skimmed through the javadoc but didn't see anything in particular for this at least around the message loggers which are the ones that help with internationalization.
>
> I think it could be fitted but would require a fair amount of changes, such as making some static loggers, particularly those for named cache components non static in order to take the cache name. Maybe you could have a named cache component for a log factory?
A workaround that IMHO feels a little hackish though would be to simply
append the current cache's name to the class name when instantiating a
logger:

logger = LoggerFactory.getLogger(getClass().getName() + "[cache = " +
cacheName + "]")

I wouldn't recommend this.

> The other potential can of worms here is when multiple cache managers are in action (i.e. managed environments) and you have multiple cache managers with same cache names. You could end up having to put cache manager as well and this could get too verbose. It could maybe be configurable somehow.
>
> David, any other ideas?
>
>> On 27 Apr 2011, at 13:21, Olaf Bergner wrote:
>>
>>> Silly me, forgot the link: http://logback.qos.ch/manual/mdc.html.
>>>
>>> Am 27.04.11 16:55, schrieb Mircea Markus:
>>>> Hi,
>>>>
>>>> I'm looking into some logs for the a JBW demo : it has 4 caches deployed on each node and lots of topology changes happen. It's close to impossible to tell  which log pertains to which cache, especially around the DistributionInterceptorImpl.
>>>> Wouldn't it make sense that, for certain components, to include the name of the cache in the logs? IThis might be achieved with minimal changes by adding an additional param to the LogFactory.getLog(Class) method and let the logger itself do the heavy lifting.
>>>> e.g.
>>>> Log l = LogFactory.getLog(DistributionManagerImpl.class, "cacheName");
>>>> and on each call l.trace("A message") the logger might output, besides underlying log's format, the string "[cacheName] A message".
>>>>
>>>> Wdyt?
>>>> Cheers,
>>>> Mircea
>>>> _______________________________________________
>>>> infinispan-dev mailing list
>>>> [hidden email]
>>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>>>
>>> _______________________________________________
>>> infinispan-dev mailing list
>>> [hidden email]
>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>> --
>> Manik Surtani
>> [hidden email]
>> twitter.com/maniksurtani
>>
>> Lead, Infinispan
>> http://www.infinispan.org
>>
>>
>>
>> _______________________________________________
>> infinispan-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
> --
> Galder Zamarreño
> Sr. Software Engineer
> Infinispan, JBoss Cache
>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>

_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] cache name in logs

Dan Berindei
In reply to this post by Galder Zamarreno
JBoss Logging does support MDC:
http://community.jboss.org/wiki/UsingMDCInJBossAS6Applications

It's not exactly what Mircea wants though, because the decision to
include or not the cache name in the log will be at the appender level
and not at the logger level. So all the log messages will include the
cache name, not just the messages for some of the components.

Dan


On Fri, Apr 29, 2011 at 5:55 PM, Galder Zamarreño <[hidden email]> wrote:

>
> On Apr 28, 2011, at 11:47 PM, Manik Surtani wrote:
>
>> We do now support JBoss Logging.
>>
>> https://issues.jboss.org/browse/ISPN-380
>>
>> @Galder, does JBoss Logging have support for what Mircea mentioned below?
>
> I've skimmed through the javadoc but didn't see anything in particular for this at least around the message loggers which are the ones that help with internationalization.
>
> I think it could be fitted but would require a fair amount of changes, such as making some static loggers, particularly those for named cache components non static in order to take the cache name. Maybe you could have a named cache component for a log factory?
>
> The other potential can of worms here is when multiple cache managers are in action (i.e. managed environments) and you have multiple cache managers with same cache names. You could end up having to put cache manager as well and this could get too verbose. It could maybe be configurable somehow.
>
> David, any other ideas?
>
>>
>> On 27 Apr 2011, at 13:21, Olaf Bergner wrote:
>>
>>> Silly me, forgot the link: http://logback.qos.ch/manual/mdc.html.
>>>
>>> Am 27.04.11 16:55, schrieb Mircea Markus:
>>>> Hi,
>>>>
>>>> I'm looking into some logs for the a JBW demo : it has 4 caches deployed on each node and lots of topology changes happen. It's close to impossible to tell  which log pertains to which cache, especially around the DistributionInterceptorImpl.
>>>> Wouldn't it make sense that, for certain components, to include the name of the cache in the logs? IThis might be achieved with minimal changes by adding an additional param to the LogFactory.getLog(Class) method and let the logger itself do the heavy lifting.
>>>> e.g.
>>>> Log l = LogFactory.getLog(DistributionManagerImpl.class, "cacheName");
>>>> and on each call l.trace("A message") the logger might output, besides underlying log's format, the string "[cacheName] A message".
>>>>
>>>> Wdyt?
>>>> Cheers,
>>>> Mircea
>>>> _______________________________________________
>>>> infinispan-dev mailing list
>>>> [hidden email]
>>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>>>
>>>
>>> _______________________________________________
>>> infinispan-dev mailing list
>>> [hidden email]
>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>
>> --
>> Manik Surtani
>> [hidden email]
>> twitter.com/maniksurtani
>>
>> Lead, Infinispan
>> http://www.infinispan.org
>>
>>
>>
>> _______________________________________________
>> infinispan-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
> --
> Galder Zamarreño
> Sr. Software Engineer
> Infinispan, JBoss Cache
>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>

_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] cache name in logs

Mircea Markus
In reply to this post by Olaf Bergner

On 29 Apr 2011, at 16:26, Olaf Bergner wrote:

> Am 29.04.11 16:55, schrieb Galder Zamarreño:
>> On Apr 28, 2011, at 11:47 PM, Manik Surtani wrote:
>>
>>> We do now support JBoss Logging.
>>>
>>> https://issues.jboss.org/browse/ISPN-380
>>>
>>> @Galder, does JBoss Logging have support for what Mircea mentioned below?
>> I've skimmed through the javadoc but didn't see anything in particular for this at least around the message loggers which are the ones that help with internationalization.
>>
>> I think it could be fitted but would require a fair amount of changes, such as making some static loggers, particularly those for named cache components non static in order to take the cache name. Maybe you could have a named cache component for a log factory?
> A workaround that IMHO feels a little hackish though would be to simply
> append the current cache's name to the class name when instantiating a
> logger:
>
> logger = LoggerFactory.getLogger(getClass().getName() + "[cache = " +
> cacheName + "]")
>
> I wouldn't recommend this.
That would also require having a logger/class instance, and not make the logger  static. For my scenario (DisttributionManagerImpl) that might work as there's a single DisttributionManagerImpl per Cache.
Besides not being able to make the logger static. any other reasons for not going with this approach?
_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] cache name in logs

Manik Surtani
My vote is to go with the MDC approach.

On 29 Apr 2011, at 11:33, Mircea Markus wrote:

>
> On 29 Apr 2011, at 16:26, Olaf Bergner wrote:
>
>> Am 29.04.11 16:55, schrieb Galder Zamarreño:
>>> On Apr 28, 2011, at 11:47 PM, Manik Surtani wrote:
>>>
>>>> We do now support JBoss Logging.
>>>>
>>>> https://issues.jboss.org/browse/ISPN-380
>>>>
>>>> @Galder, does JBoss Logging have support for what Mircea mentioned below?
>>> I've skimmed through the javadoc but didn't see anything in particular for this at least around the message loggers which are the ones that help with internationalization.
>>>
>>> I think it could be fitted but would require a fair amount of changes, such as making some static loggers, particularly those for named cache components non static in order to take the cache name. Maybe you could have a named cache component for a log factory?
>> A workaround that IMHO feels a little hackish though would be to simply
>> append the current cache's name to the class name when instantiating a
>> logger:
>>
>> logger = LoggerFactory.getLogger(getClass().getName() + "[cache = " +
>> cacheName + "]")
>>
>> I wouldn't recommend this.
> That would also require having a logger/class instance, and not make the logger  static. For my scenario (DisttributionManagerImpl) that might work as there's a single DisttributionManagerImpl per Cache.
> Besides not being able to make the logger static. any other reasons for not going with this approach?
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Manik Surtani
[hidden email]
twitter.com/maniksurtani

Lead, Infinispan
http://www.infinispan.org




_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] cache name in logs

David M. Lloyd-2
In reply to this post by Galder Zamarreno
I would just use NDC or MDC honestly.

NDC.push(cacheName);
try {
    do user stuff;
} finally {
    NDC.pop();
}

Similar if you want to use an MDC key.

On 04/29/2011 09:55 AM, Galder Zamarreño wrote:

>
> On Apr 28, 2011, at 11:47 PM, Manik Surtani wrote:
>
>> We do now support JBoss Logging.
>>
>> https://issues.jboss.org/browse/ISPN-380
>>
>> @Galder, does JBoss Logging have support for what Mircea mentioned below?
>
> I've skimmed through the javadoc but didn't see anything in particular for this at least around the message loggers which are the ones that help with internationalization.
>
> I think it could be fitted but would require a fair amount of changes, such as making some static loggers, particularly those for named cache components non static in order to take the cache name. Maybe you could have a named cache component for a log factory?
>
> The other potential can of worms here is when multiple cache managers are in action (i.e. managed environments) and you have multiple cache managers with same cache names. You could end up having to put cache manager as well and this could get too verbose. It could maybe be configurable somehow.
>
> David, any other ideas?
>
>>
>> On 27 Apr 2011, at 13:21, Olaf Bergner wrote:
>>
>>> Silly me, forgot the link: http://logback.qos.ch/manual/mdc.html.
>>>
>>> Am 27.04.11 16:55, schrieb Mircea Markus:
>>>> Hi,
>>>>
>>>> I'm looking into some logs for the a JBW demo : it has 4 caches deployed on each node and lots of topology changes happen. It's close to impossible to tell  which log pertains to which cache, especially around the DistributionInterceptorImpl.
>>>> Wouldn't it make sense that, for certain components, to include the name of the cache in the logs? IThis might be achieved with minimal changes by adding an additional param to the LogFactory.getLog(Class) method and let the logger itself do the heavy lifting.
>>>> e.g.
>>>> Log l = LogFactory.getLog(DistributionManagerImpl.class, "cacheName");
>>>> and on each call l.trace("A message") the logger might output, besides underlying log's format, the string "[cacheName] A message".
>>>>
>>>> Wdyt?
>>>> Cheers,
>>>> Mircea
>>>> _______________________________________________
>>>> infinispan-dev mailing list
>>>> [hidden email]
>>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>>>
>>>
>>> _______________________________________________
>>> infinispan-dev mailing list
>>> [hidden email]
>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>
>> --
>> Manik Surtani
>> [hidden email]
>> twitter.com/maniksurtani
>>
>> Lead, Infinispan
>> http://www.infinispan.org
>>
>>
>>
>> _______________________________________________
>> infinispan-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
> --
> Galder Zamarreño
> Sr. Software Engineer
> Infinispan, JBoss Cache
>


--
- DML
_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] cache name in logs

Mircea Markus
In reply to this post by Dan Berindei

On 29 Apr 2011, at 16:30, Dan Berindei wrote:

> JBoss Logging does support MDC:
> http://community.jboss.org/wiki/UsingMDCInJBossAS6Applications
>
> It's not exactly what Mircea wants though, because the decision to
> include or not the cache name in the log will be at the appender level
> and not at the logger level. So all the log messages will include the
> cache name, not just the messages for some of the components.
>
> Dan
Indeed, for the format element [%X{cacheName}] that would cause an empty "[]" to be displayed when cacheName is not present.
Would be nice if the formatter can be set to ignore the whole "[%X{cacheName}]" if cacheName is not present. Not sure that's possible though.
A workaround would be to move part of the formatting in the MDC param itself:

MDC.put("cacheName", "["+cacheName + "]);
try {
   do user stuff;
} finally {
   MDC.remove("cacheName");
}

and the formatter won't include the square braces: "%X{cacheName}" instead of [%X{cacheName}]

>
>
> On Fri, Apr 29, 2011 at 5:55 PM, Galder Zamarreño <[hidden email]> wrote:
>>
>> On Apr 28, 2011, at 11:47 PM, Manik Surtani wrote:
>>
>>> We do now support JBoss Logging.
>>>
>>> https://issues.jboss.org/browse/ISPN-380
>>>
>>> @Galder, does JBoss Logging have support for what Mircea mentioned below?
>>
>> I've skimmed through the javadoc but didn't see anything in particular for this at least around the message loggers which are the ones that help with internationalization.
>>
>> I think it could be fitted but would require a fair amount of changes, such as making some static loggers, particularly those for named cache components non static in order to take the cache name. Maybe you could have a named cache component for a log factory?
>>
>> The other potential can of worms here is when multiple cache managers are in action (i.e. managed environments) and you have multiple cache managers with same cache names. You could end up having to put cache manager as well and this could get too verbose. It could maybe be configurable somehow.
>>
>> David, any other ideas?
>>
>>>
>>> On 27 Apr 2011, at 13:21, Olaf Bergner wrote:
>>>
>>>> Silly me, forgot the link: http://logback.qos.ch/manual/mdc.html.
>>>>
>>>> Am 27.04.11 16:55, schrieb Mircea Markus:
>>>>> Hi,
>>>>>
>>>>> I'm looking into some logs for the a JBW demo : it has 4 caches deployed on each node and lots of topology changes happen. It's close to impossible to tell  which log pertains to which cache, especially around the DistributionInterceptorImpl.
>>>>> Wouldn't it make sense that, for certain components, to include the name of the cache in the logs? IThis might be achieved with minimal changes by adding an additional param to the LogFactory.getLog(Class) method and let the logger itself do the heavy lifting.
>>>>> e.g.
>>>>> Log l = LogFactory.getLog(DistributionManagerImpl.class, "cacheName");
>>>>> and on each call l.trace("A message") the logger might output, besides underlying log's format, the string "[cacheName] A message".
>>>>>
>>>>> Wdyt?
>>>>> Cheers,
>>>>> Mircea
>>>>> _______________________________________________
>>>>> infinispan-dev mailing list
>>>>> [hidden email]
>>>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>>>>
>>>>
>>>> _______________________________________________
>>>> infinispan-dev mailing list
>>>> [hidden email]
>>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>>
>>> --
>>> Manik Surtani
>>> [hidden email]
>>> twitter.com/maniksurtani
>>>
>>> Lead, Infinispan
>>> http://www.infinispan.org
>>>
>>>
>>>
>>> _______________________________________________
>>> infinispan-dev mailing list
>>> [hidden email]
>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>
>> --
>> Galder Zamarreño
>> Sr. Software Engineer
>> Infinispan, JBoss Cache
>>
>>
>> _______________________________________________
>> infinispan-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] cache name in logs

Mircea Markus
In reply to this post by Manik Surtani

On 29 Apr 2011, at 16:37, Manik Surtani wrote:

> My vote is to go with the MDC approach.
+1
I will create a JIRA for this. Before that just want to ask which other components than Distribution manager would benefit from this approach? I'm thinking about:
DsitributionManagerImpl
TransactionTable (it also reacts to view changes, so multiple caches on the same CM would create confusing logs)...
Other?

Or would it be a good idea to have it for ALL the the logs in we output? After it doesn't make a lot of noise...

Cheers,
Mircea

>
> On 29 Apr 2011, at 11:33, Mircea Markus wrote:
>
>>
>> On 29 Apr 2011, at 16:26, Olaf Bergner wrote:
>>
>>> Am 29.04.11 16:55, schrieb Galder Zamarreño:
>>>> On Apr 28, 2011, at 11:47 PM, Manik Surtani wrote:
>>>>
>>>>> We do now support JBoss Logging.
>>>>>
>>>>> https://issues.jboss.org/browse/ISPN-380
>>>>>
>>>>> @Galder, does JBoss Logging have support for what Mircea mentioned below?
>>>> I've skimmed through the javadoc but didn't see anything in particular for this at least around the message loggers which are the ones that help with internationalization.
>>>>
>>>> I think it could be fitted but would require a fair amount of changes, such as making some static loggers, particularly those for named cache components non static in order to take the cache name. Maybe you could have a named cache component for a log factory?
>>> A workaround that IMHO feels a little hackish though would be to simply
>>> append the current cache's name to the class name when instantiating a
>>> logger:
>>>
>>> logger = LoggerFactory.getLogger(getClass().getName() + "[cache = " +
>>> cacheName + "]")
>>>
>>> I wouldn't recommend this.
>> That would also require having a logger/class instance, and not make the logger  static. For my scenario (DisttributionManagerImpl) that might work as there's a single DisttributionManagerImpl per Cache.
>> Besides not being able to make the logger static. any other reasons for not going with this approach?
>> _______________________________________________
>> infinispan-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
> --
> Manik Surtani
> [hidden email]
> twitter.com/maniksurtani
>
> Lead, Infinispan
> http://www.infinispan.org
>
>
>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] cache name in logs

Manik Surtani
I think any log attached to a named cache component (versus a global component) should present cache name.

On 29 Apr 2011, at 12:48, Mircea Markus wrote:

>
> On 29 Apr 2011, at 16:37, Manik Surtani wrote:
>
>> My vote is to go with the MDC approach.
> +1
> I will create a JIRA for this. Before that just want to ask which other components than Distribution manager would benefit from this approach? I'm thinking about:
> DsitributionManagerImpl
> TransactionTable (it also reacts to view changes, so multiple caches on the same CM would create confusing logs)...
> Other?
>
> Or would it be a good idea to have it for ALL the the logs in we output? After it doesn't make a lot of noise...
>
> Cheers,
> Mircea
>
>>
>> On 29 Apr 2011, at 11:33, Mircea Markus wrote:
>>
>>>
>>> On 29 Apr 2011, at 16:26, Olaf Bergner wrote:
>>>
>>>> Am 29.04.11 16:55, schrieb Galder Zamarreño:
>>>>> On Apr 28, 2011, at 11:47 PM, Manik Surtani wrote:
>>>>>
>>>>>> We do now support JBoss Logging.
>>>>>>
>>>>>> https://issues.jboss.org/browse/ISPN-380
>>>>>>
>>>>>> @Galder, does JBoss Logging have support for what Mircea mentioned below?
>>>>> I've skimmed through the javadoc but didn't see anything in particular for this at least around the message loggers which are the ones that help with internationalization.
>>>>>
>>>>> I think it could be fitted but would require a fair amount of changes, such as making some static loggers, particularly those for named cache components non static in order to take the cache name. Maybe you could have a named cache component for a log factory?
>>>> A workaround that IMHO feels a little hackish though would be to simply
>>>> append the current cache's name to the class name when instantiating a
>>>> logger:
>>>>
>>>> logger = LoggerFactory.getLogger(getClass().getName() + "[cache = " +
>>>> cacheName + "]")
>>>>
>>>> I wouldn't recommend this.
>>> That would also require having a logger/class instance, and not make the logger  static. For my scenario (DisttributionManagerImpl) that might work as there's a single DisttributionManagerImpl per Cache.
>>> Besides not being able to make the logger static. any other reasons for not going with this approach?
>>> _______________________________________________
>>> infinispan-dev mailing list
>>> [hidden email]
>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>
>> --
>> Manik Surtani
>> [hidden email]
>> twitter.com/maniksurtani
>>
>> Lead, Infinispan
>> http://www.infinispan.org
>>
>>
>>
>>
>> _______________________________________________
>> infinispan-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Manik Surtani
[hidden email]
twitter.com/maniksurtani

Lead, Infinispan
http://www.infinispan.org




_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] cache name in logs

Galder Zamarreno
+1 to limiting to named cache components

On Apr 29, 2011, at 7:23 PM, Manik Surtani wrote:

> I think any log attached to a named cache component (versus a global component) should present cache name.
>
> On 29 Apr 2011, at 12:48, Mircea Markus wrote:
>
>>
>> On 29 Apr 2011, at 16:37, Manik Surtani wrote:
>>
>>> My vote is to go with the MDC approach.
>> +1
>> I will create a JIRA for this. Before that just want to ask which other components than Distribution manager would benefit from this approach? I'm thinking about:
>> DsitributionManagerImpl
>> TransactionTable (it also reacts to view changes, so multiple caches on the same CM would create confusing logs)...
>> Other?
>>
>> Or would it be a good idea to have it for ALL the the logs in we output? After it doesn't make a lot of noise...
>>
>> Cheers,
>> Mircea
>>
>>>
>>> On 29 Apr 2011, at 11:33, Mircea Markus wrote:
>>>
>>>>
>>>> On 29 Apr 2011, at 16:26, Olaf Bergner wrote:
>>>>
>>>>> Am 29.04.11 16:55, schrieb Galder Zamarreño:
>>>>>> On Apr 28, 2011, at 11:47 PM, Manik Surtani wrote:
>>>>>>
>>>>>>> We do now support JBoss Logging.
>>>>>>>
>>>>>>> https://issues.jboss.org/browse/ISPN-380
>>>>>>>
>>>>>>> @Galder, does JBoss Logging have support for what Mircea mentioned below?
>>>>>> I've skimmed through the javadoc but didn't see anything in particular for this at least around the message loggers which are the ones that help with internationalization.
>>>>>>
>>>>>> I think it could be fitted but would require a fair amount of changes, such as making some static loggers, particularly those for named cache components non static in order to take the cache name. Maybe you could have a named cache component for a log factory?
>>>>> A workaround that IMHO feels a little hackish though would be to simply
>>>>> append the current cache's name to the class name when instantiating a
>>>>> logger:
>>>>>
>>>>> logger = LoggerFactory.getLogger(getClass().getName() + "[cache = " +
>>>>> cacheName + "]")
>>>>>
>>>>> I wouldn't recommend this.
>>>> That would also require having a logger/class instance, and not make the logger  static. For my scenario (DisttributionManagerImpl) that might work as there's a single DisttributionManagerImpl per Cache.
>>>> Besides not being able to make the logger static. any other reasons for not going with this approach?
>>>> _______________________________________________
>>>> infinispan-dev mailing list
>>>> [hidden email]
>>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>>
>>> --
>>> Manik Surtani
>>> [hidden email]
>>> twitter.com/maniksurtani
>>>
>>> Lead, Infinispan
>>> http://www.infinispan.org
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> infinispan-dev mailing list
>>> [hidden email]
>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>
>>
>> _______________________________________________
>> infinispan-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
> --
> Manik Surtani
> [hidden email]
> twitter.com/maniksurtani
>
> Lead, Infinispan
> http://www.infinispan.org
>
>
>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] cache name in logs

Manik Surtani
Have we got a JIRA for this BTW?

On 2 May 2011, at 08:16, Galder Zamarreño wrote:

> +1 to limiting to named cache components
>
> On Apr 29, 2011, at 7:23 PM, Manik Surtani wrote:
>
>> I think any log attached to a named cache component (versus a global component) should present cache name.



--
Manik Surtani
[hidden email]
twitter.com/maniksurtani

Lead, Infinispan
http://www.infinispan.org




_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] cache name in logs

Galder Zamarreno
https://issues.jboss.org/browse/ISPN-1112

On May 13, 2011, at 3:04 PM, Manik Surtani wrote:

> Have we got a JIRA for this BTW?
>
> On 2 May 2011, at 08:16, Galder Zamarreño wrote:
>
>> +1 to limiting to named cache components
>>
>> On Apr 29, 2011, at 7:23 PM, Manik Surtani wrote:
>>
>>> I think any log attached to a named cache component (versus a global component) should present cache name.
>
>
>
> --
> Manik Surtani
> [hidden email]
> twitter.com/maniksurtani
>
> Lead, Infinispan
> http://www.infinispan.org
>
>
>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev