You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@manifoldcf.apache.org by Farzad Valad <ho...@farzad.net> on 2011/05/26 23:33:07 UTC

Logging Hierarchy

I'm still a bit confused about the relationship of the logging levels 
defined in logging.ini file vs properties.xml.  Just a second ago I 
couldn't get a single line, finally put everything at DEBUG for sanity 
check.

All I want is INFO level for connectors and WARN throughout the rest.  I 
thought if I set the logging.ini rootAppender to WARN and just the 
connectors subsystem to INFO should do it.  I guess I don't understand 
it like I should.  Thoughts?

I even have this statement in the constructor of my connector that 
doesn't print, Logging.connectors.log(Level.ALL, "DupFinder Version 1.0.0");

Thanks!

Re: Logging Hierarchy

Posted by Karl Wright <da...@gmail.com>.
You may also want to look at this reference:

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

Looking at your properties.xml and logging.ini file, I see no obvious
reason that your assignment of log level INFO to
org.apache.manifoldcf.connectors should not cause info, warn, error,
and fatal messages to be logged.

Karl

On Thu, May 26, 2011 at 7:58 PM, Karl Wright <da...@gmail.com> wrote:
> (1) Logging.  The way the logging works is that there are ManifoldCF
> system loggers, and everything else.  System loggers are the ones that
> you talk about in the properties.xml file.  The logging level (and
> ONLY the logging level) is overridden for the system loggers by means
> of the properties.xml file.  Everything else is under control of
> logging.ini.  So logging.ini sets the default logging level for the
> system loggers too.
>
> This breakdown is historical, in part, and may be replaced some day by
> having everything done through logging.ini.  Or not, because most of
> the time ManifoldCF developers simply need to work with properties.xml
> and forget about logging.ini.
>
> (2) The default value for all system loggers is WARN.
>
> (3) To set the logging level for connectors to INFO, and leave
> everything else at WARN, just leave logging.ini alone and change the
> properties.xml property org.apache.manifoldcf.connectors to have the
> value "INFO".
>
> (4) I don't know why your log statement doesn't work, but there's
> nothing unusual about how the logger is set up, other than that it
> occurs during ManifoldCF.initializeSystem(), which is called very
> early on.  So this must be a log4j issue. Try
> Logging.connectors.info("...") and see if that works.
>
> Karl
>
>
> On Thu, May 26, 2011 at 5:33 PM, Farzad Valad <ho...@farzad.net> wrote:
>> I'm still a bit confused about the relationship of the logging levels
>> defined in logging.ini file vs properties.xml.  Just a second ago I couldn't
>> get a single line, finally put everything at DEBUG for sanity check.
>>
>> All I want is INFO level for connectors and WARN throughout the rest.  I
>> thought if I set the logging.ini rootAppender to WARN and just the
>> connectors subsystem to INFO should do it.  I guess I don't understand it
>> like I should.  Thoughts?
>>
>> I even have this statement in the constructor of my connector that doesn't
>> print, Logging.connectors.log(Level.ALL, "DupFinder Version 1.0.0");
>>
>> Thanks!
>>
>

Re: Logging Hierarchy

Posted by Karl Wright <da...@gmail.com>.
(1) Logging.  The way the logging works is that there are ManifoldCF
system loggers, and everything else.  System loggers are the ones that
you talk about in the properties.xml file.  The logging level (and
ONLY the logging level) is overridden for the system loggers by means
of the properties.xml file.  Everything else is under control of
logging.ini.  So logging.ini sets the default logging level for the
system loggers too.

This breakdown is historical, in part, and may be replaced some day by
having everything done through logging.ini.  Or not, because most of
the time ManifoldCF developers simply need to work with properties.xml
and forget about logging.ini.

(2) The default value for all system loggers is WARN.

(3) To set the logging level for connectors to INFO, and leave
everything else at WARN, just leave logging.ini alone and change the
properties.xml property org.apache.manifoldcf.connectors to have the
value "INFO".

(4) I don't know why your log statement doesn't work, but there's
nothing unusual about how the logger is set up, other than that it
occurs during ManifoldCF.initializeSystem(), which is called very
early on.  So this must be a log4j issue. Try
Logging.connectors.info("...") and see if that works.

Karl


On Thu, May 26, 2011 at 5:33 PM, Farzad Valad <ho...@farzad.net> wrote:
> I'm still a bit confused about the relationship of the logging levels
> defined in logging.ini file vs properties.xml.  Just a second ago I couldn't
> get a single line, finally put everything at DEBUG for sanity check.
>
> All I want is INFO level for connectors and WARN throughout the rest.  I
> thought if I set the logging.ini rootAppender to WARN and just the
> connectors subsystem to INFO should do it.  I guess I don't understand it
> like I should.  Thoughts?
>
> I even have this statement in the constructor of my connector that doesn't
> print, Logging.connectors.log(Level.ALL, "DupFinder Version 1.0.0");
>
> Thanks!
>