Overview
Features
Download
Documentation
Community
Add-Ons & Services

Refreshing logging settings

Please post support and help requests here.
rd
Posts: 19
Joined: 16 Jun 2007, 15:30

Refreshing logging settings

Postby rd » 16 Oct 2007, 13:36

Hi,

I would like to be able to change the logging settings of a running program.

The first problem is to refresh the logging configuration. At the moment I'm using a PropertyFileConfiguration file to configure the settings, but there doesn't seem to be a way to make it reload the properties file. What is the best solution for this ?

After the configuration is updated, I think I should use the following code to update the logging subsystem:

LoggingConfigurator configurator;
configurator.configure(&this->config());

This seems to work, but sometimes I have the problem that the AsyncStream blocks forever in its destructor. Is it not allowed to reconfigure the logging subsystem?

Thanks,

Ronny



alex
Posts: 1209
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Refreshing logging settings

Postby alex » 21 Oct 2007, 01:16

> The first problem is to refresh the logging configuration. At the moment I'm using a PropertyFileConfiguration file to configure the settings, but there doesn't seem to be a way to make it reload the properties file. What is the best solution for this ?

These two PropertyFileConfiguration methods look like the best candidates for the task:

Code: Select all


void load(std::istream& istr);
   /// Loads the configuration data from the given stream, which
   /// must be in properties file format.
      
void load(const std::string& path);
   /// Loads the configuration data from the given file, which
   /// must be in properties file format.


> After the configuration is updated, I think I should use the following code to update the logging subsystem:
>
> LoggingConfigurator configurator;
> configurator.configure(&this->config());
>
> This seems to work, but sometimes I have the problem that the AsyncStream blocks forever in its destructor. Is it not allowed to reconfigure the logging subsystem?

I couldn't find any association between 'AsyncStream' (I assume you are doing something with AsyncStreamChannel) and LoggingConfigurator. You should provide some code.

Alex


Return to “Support”

Who is online

Users browsing this forum: No registered users and 3 guests