logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: Getting Started under VS2005
Date Thu, 27 Sep 2007 16:26:57 GMT

On Sep 27, 2007, at 6:49 AM, Johannes.Frank@kisters.de wrote:

> Great Thanks to you both!
> With your help, I managed to get the first example of log4cxx running.
> the Second example (which should take an optional filename as  
> argument to read the config from) Fails, because the method wants a  
> File handler rather than a chararray)
> Solution was as follows:
>         File* file = new File("test.txt");
>                 PropertyConfigurator::configure(*file);
> with this configuration, It reads the file test.txt from the  
> projects root directory and interpretes it correctly, allowing me  
> to configure appenders inside the file "test.txt"
> At Last I can see a dim light at the horizon :)
> Thanks again :)
> Greetings,
> Johannes Frank

There is no need to dynamically allocate File.  You could do:

File file("test.txt");


PropertyConfigurator::configure(File( "test.txt"));

log4j does have a configure(String) method, so it would be reasonable  
to add a configure(const std::string&) and configure(const  
std::wstring&) methods to PropertyConfigurator.

View raw message