You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by deepak singh <de...@gmail.com> on 2009/05/22 10:23:14 UTC

Issue with log4cxx configuration

Hi,

 I am using property file to configure the log4cxx. I am not able to check
the correctness of the input file.

 I tried the try, catch but PropertyConfigurator::configure function is not
throwing any exception.

 I passed the dummy property file and in this case configure file printing
following messages:

* log4cxx: No appender could be found for logger (root).*

* log4cxx: Please initialize the log4cxx system properly.   *

 Please let me know how to catch this error?

-------------------Code-----------------

void InitLog(const char *file)

{

     log4cxx::PropertyConfigurator::configure(log4cxx::File(file));

 }

Re: Issue with log4cxx configuration

Posted by Assaf Lavie <as...@gmail.com>.
Well, I'm fairly new to log4cxx, but I do think that you should be able to
see what's wrong with the parsing of the configuration file by putting the
following line at the top:
log4j.debug=true


On Fri, May 22, 2009 at 10:23 AM, deepak singh <de...@gmail.com>wrote:

>  Hi,
>
>  I am using property file to configure the log4cxx. I am not able to check
> the correctness of the input file.
>
>  I tried the try, catch but PropertyConfigurator::configure function is not
> throwing any exception.
>
>  I passed the dummy property file and in this case configure file printing
> following messages:
>
> * log4cxx: No appender could be found for logger (root).*
>
> * log4cxx: Please initialize the log4cxx system properly.   *
>
>  Please let me know how to catch this error?
>
> -------------------Code-----------------
>
> void InitLog(const char *file)
>
> {
>
>      log4cxx::PropertyConfigurator::configure(log4cxx::File(file));
>
>  }
>