Skip to content

Commit

Permalink
Fixes for review findings
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-slac committed Oct 20, 2016
1 parent e738781 commit 3ee90bb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions doc/mainpage.dox
Original file line number Diff line number Diff line change
Expand Up @@ -218,17 +218,17 @@ Below is an example of an XML file that configures three appenders and two logge

The root logger is setup to append to both the console and the file `var/log/qserv-master.log` with a threshold of "INFO". The named logger "debugs", meanwhile, is set to exclusively append to the file `var/log/debugs.log` with a threshold of "DEBUG". In this way, "debugs" may capture and isolate verbose debugging messages without polluting the main log. This behavior is triggered by setting the `additivity` attribute of the `category` tag to `"false"`. If `additivity` were set to `"true"` (the default value), all messages sent to "debugs" that met its threshold of "DEBUG" would also be sent to the console and `var/log/qserv-master.log`, the targets of the appenders associated with the root logger.

Note that as an alternative to XML, a configuration file containing log4j Java properties may be used. Here's a trivial example of a log4j properties file that corresponds to the `BasicConfigurator` previously mentioned:
Note that as an alternative to XML, a configuration file containing log4j Java properties may be used. Here's a trivial example of a log4j properties file that corresponds to default configuration described above:

# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=DEBUG, A1
# Set root logger level to INFO and its only appender to A1.
log4j.rootLogger=INFO, A1

# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
log4j.appender.A1.layout.ConversionPattern=%c %p: %m%n


Values in the configuration file can include Unix environment variables using the "`${ENVVAR}`" notation. In addition, "`${user.home}`" and "`${user.name}`" may be useful substitutions. Note that "`~`" substitution does ''not'' work.
Expand Down
2 changes: 1 addition & 1 deletion src/Log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void configFromFile(std::string const& filename) {
* If LSST_LOG_CONFIG envvar is defined and points to existing file then
* use that file to configure (can be either XML or Properties file).
* Otherwise use pre-defined configuration - add console appender to root
* logger using pattern layout with the above pattern, level set to WARN.
* logger using pattern layout with the above pattern, level set to INFO.
*
* IF LOG4CXX was initialized already and you want to reset it then call
* `log4cxx::BasicConfigurator::resetConfiguration()` first.
Expand Down
3 changes: 1 addition & 2 deletions tests/testLog.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def testDefaultLogger(self):
def testBasic(self):
"""
Test basic log output with default configuration.
Since the default threshold is WARN, the INFO, DEBUG, or TRACE
Since the default threshold is INFO, the DEBUG or TRACE
message is not emitted.
"""
with TestLog.StdoutCapture(self.outputFilename):
Expand Down Expand Up @@ -287,7 +287,6 @@ def testPythonLogging(self):
lgr.setLevel(logging.INFO)
lgr.addHandler(log.LogHandler())
log.configure()
log.setLevel('', log.INFO)
lgr.info("This is INFO")
lgr.debug("This is DEBUG")
logging.shutdown()
Expand Down

0 comments on commit 3ee90bb

Please sign in to comment.