You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apex.apache.org by Chandni Singh <ch...@datatorrent.com> on 2016/04/19 23:30:50 UTC

DTLoggerFactory behavior

Hi,

Initially when DTLoggerFactory was created it's behavior was not very well
defined with respect to packages and sub-packages.

As we are moving to org.apache.apex package,  I am having trouble setting
log level to DEBUG for all org.apache.apex.* classes.

I suspect this is because in some log4j.properties org.apache=INFO
overrides org.apache.apex=DEBUG and also the order in which these entries
are encountered changes the behavior.

We need to fix this and this is what I am thinking of doing.

Packages are represented as a prefix tree (trie). For example:
             org
             |
      apache (INFO)
        |
    apex (DEBUG)

If org.apache is set to INFO but org.apache.apex is set to DEBUG then all
classes which are sub-packages of org.apache.apex will log at DEBUG level

Classes which are sub-packages of org.apache but not org.apache.apex will
log at INFO level.

Will create a JIRA for this and start the work soon.

Thanks,
Chandni

Re: DTLoggerFactory behavior

Posted by Pramod Immaneni <pr...@datatorrent.com>.
Chandni,

According to log4j documentation here

https://logging.apache.org/log4j/1.2/manual.html

Example 3
Logger
nameAssigned
levelInherited
level
root Proot Proot
X Px Px
X.Y none Px
X.Y.Z Pxyz Pxyz


the sub-package override should be supported by default. Could it be the
reason it is not happening is because of the way we are changing it
dynamically at runtime.

Thanks

On Tue, Apr 19, 2016 at 2:30 PM, Chandni Singh <ch...@datatorrent.com>
wrote:

> Hi,
>
> Initially when DTLoggerFactory was created it's behavior was not very well
> defined with respect to packages and sub-packages.
>
> As we are moving to org.apache.apex package,  I am having trouble setting
> log level to DEBUG for all org.apache.apex.* classes.
>
> I suspect this is because in some log4j.properties org.apache=INFO
> overrides org.apache.apex=DEBUG and also the order in which these entries
> are encountered changes the behavior.
>
> We need to fix this and this is what I am thinking of doing.
>
> Packages are represented as a prefix tree (trie). For example:
>              org
>              |
>       apache (INFO)
>         |
>     apex (DEBUG)
>
> If org.apache is set to INFO but org.apache.apex is set to DEBUG then all
> classes which are sub-packages of org.apache.apex will log at DEBUG level
>
> Classes which are sub-packages of org.apache but not org.apache.apex will
> log at INFO level.
>
> Will create a JIRA for this and start the work soon.
>
> Thanks,
> Chandni
>

Re: DTLoggerFactory behavior

Posted by Thomas Weise <th...@datatorrent.com>.
+1 this will help us tune the logger settings for unit tests also.


On Tue, Apr 19, 2016 at 2:39 PM, Vlad Rozov <v....@datatorrent.com> wrote:
> +1. The behavior should be the same as if DTLoggerFactory is not
> instantiated. It should only affect logging for classes that are explicitly
> defined in DTLoggerFactory pattern.
>
> Thank you,
>
> Vlad
>
>
> On 4/19/16 14:30, Chandni Singh wrote:
>>
>> Hi,
>>
>> Initially when DTLoggerFactory was created it's behavior was not very well
>> defined with respect to packages and sub-packages.
>>
>> As we are moving to org.apache.apex package,  I am having trouble setting
>> log level to DEBUG for all org.apache.apex.* classes.
>>
>> I suspect this is because in some log4j.properties org.apache=INFO
>> overrides org.apache.apex=DEBUG and also the order in which these entries
>> are encountered changes the behavior.
>>
>> We need to fix this and this is what I am thinking of doing.
>>
>> Packages are represented as a prefix tree (trie). For example:
>>               org
>>               |
>>        apache (INFO)
>>          |
>>      apex (DEBUG)
>>
>> If org.apache is set to INFO but org.apache.apex is set to DEBUG then all
>> classes which are sub-packages of org.apache.apex will log at DEBUG level
>>
>> Classes which are sub-packages of org.apache but not org.apache.apex will
>> log at INFO level.
>>
>> Will create a JIRA for this and start the work soon.
>>
>> Thanks,
>> Chandni
>>
>

Re: DTLoggerFactory behavior

Posted by Vlad Rozov <v....@datatorrent.com>.
+1. The behavior should be the same as if DTLoggerFactory is not 
instantiated. It should only affect logging for classes that are 
explicitly defined in DTLoggerFactory pattern.

Thank you,

Vlad

On 4/19/16 14:30, Chandni Singh wrote:
> Hi,
>
> Initially when DTLoggerFactory was created it's behavior was not very well
> defined with respect to packages and sub-packages.
>
> As we are moving to org.apache.apex package,  I am having trouble setting
> log level to DEBUG for all org.apache.apex.* classes.
>
> I suspect this is because in some log4j.properties org.apache=INFO
> overrides org.apache.apex=DEBUG and also the order in which these entries
> are encountered changes the behavior.
>
> We need to fix this and this is what I am thinking of doing.
>
> Packages are represented as a prefix tree (trie). For example:
>               org
>               |
>        apache (INFO)
>          |
>      apex (DEBUG)
>
> If org.apache is set to INFO but org.apache.apex is set to DEBUG then all
> classes which are sub-packages of org.apache.apex will log at DEBUG level
>
> Classes which are sub-packages of org.apache but not org.apache.apex will
> log at INFO level.
>
> Will create a JIRA for this and start the work soon.
>
> Thanks,
> Chandni
>


Re: DTLoggerFactory behavior

Posted by Chandni Singh <ch...@datatorrent.com>.
Yes.

On Tue, Apr 19, 2016 at 4:07 PM, Munagala Ramanath <ra...@datatorrent.com>
wrote:

> Conversely, if org.apache is set to DEBUG and org.apache.apex is set to
> INFO,
> will we see similar behavior, i.e. all classes in sub-packages of
> org.apache.apex
> log at INFO but all classes that are subpackages of org.apache but not
> org.apache.apex
> log at DEBUG ?
>
> Ram
>
> On Tue, Apr 19, 2016 at 2:30 PM, Chandni Singh <ch...@datatorrent.com>
> wrote:
>
> > Hi,
> >
> > Initially when DTLoggerFactory was created it's behavior was not very
> well
> > defined with respect to packages and sub-packages.
> >
> > As we are moving to org.apache.apex package,  I am having trouble setting
> > log level to DEBUG for all org.apache.apex.* classes.
> >
> > I suspect this is because in some log4j.properties org.apache=INFO
> > overrides org.apache.apex=DEBUG and also the order in which these entries
> > are encountered changes the behavior.
> >
> > We need to fix this and this is what I am thinking of doing.
> >
> > Packages are represented as a prefix tree (trie). For example:
> >              org
> >              |
> >       apache (INFO)
> >         |
> >     apex (DEBUG)
> >
> > If org.apache is set to INFO but org.apache.apex is set to DEBUG then all
> > classes which are sub-packages of org.apache.apex will log at DEBUG level
> >
> > Classes which are sub-packages of org.apache but not org.apache.apex will
> > log at INFO level.
> >
> > Will create a JIRA for this and start the work soon.
> >
> > Thanks,
> > Chandni
> >
>

Re: DTLoggerFactory behavior

Posted by Munagala Ramanath <ra...@datatorrent.com>.
Conversely, if org.apache is set to DEBUG and org.apache.apex is set to
INFO,
will we see similar behavior, i.e. all classes in sub-packages of
org.apache.apex
log at INFO but all classes that are subpackages of org.apache but not
org.apache.apex
log at DEBUG ?

Ram

On Tue, Apr 19, 2016 at 2:30 PM, Chandni Singh <ch...@datatorrent.com>
wrote:

> Hi,
>
> Initially when DTLoggerFactory was created it's behavior was not very well
> defined with respect to packages and sub-packages.
>
> As we are moving to org.apache.apex package,  I am having trouble setting
> log level to DEBUG for all org.apache.apex.* classes.
>
> I suspect this is because in some log4j.properties org.apache=INFO
> overrides org.apache.apex=DEBUG and also the order in which these entries
> are encountered changes the behavior.
>
> We need to fix this and this is what I am thinking of doing.
>
> Packages are represented as a prefix tree (trie). For example:
>              org
>              |
>       apache (INFO)
>         |
>     apex (DEBUG)
>
> If org.apache is set to INFO but org.apache.apex is set to DEBUG then all
> classes which are sub-packages of org.apache.apex will log at DEBUG level
>
> Classes which are sub-packages of org.apache but not org.apache.apex will
> log at INFO level.
>
> Will create a JIRA for this and start the work soon.
>
> Thanks,
> Chandni
>