On Aug 6, 2007, at 11:29 AM, Wilfong, Paul wrote:

On the log4cxx site, there is a "Short introduction to log4cxx". http://logging.apache.org/log4cxx/manual/Introduction.html


It includes the following example to set level:
// Now set its level. Normally you do not need to set the
// level of a logger programmatically. This is usually done
// in configuration files.
logger->setLevel(log4cxx::Level::INFO);

But when I use this I get a compiler error.

I looked at the macros (e.g. LOG4CXX_INFO) and decided to try "logger->setLevel(log4cxx::Level::INFO)" instead, which seems to work.

Is there a reason I am having trouble with the example given in the "Short Introduction"?

I've looked at old log4xx forum messages and have seen indications that the Level:: symbols were removed, but it is not clear one way or the other...




The on-line docs have:

logger->setLevel(log4cxx::Level::getInfo())

Any chance that you are using log4cxx 0.9.7? Use of log4cxx 0.9.7 is strongly discouraged due to a large number of issues that have been fixed in the SVN. Unfortunately, we have not yet been able to get an ASF release out to replace that pre-ASF release.

Use of non-local static variables (like log4cxx::Level::INFO) have been the caused of a lot of problems in log4cxx. I had tried to preserve the log4cxx::Level::INFO and the other levels, but their continued presence cause problems on some platforms and there is no way to do them right. So any code that used log4cxx::Level::INFO will to been changed to use log4cxx::Level::getInfo().

Reply via email to