Archived

This forum has been archived. Please start a new discussion on GitHub.

IceBoxService and Logger

xdm
xdm La Coruña, Spain
Hello

What is the correct way to install and Ice::Logger in IceBox services
void MyService::start(const std::string& name, const
   Ice::CommunicatorPtr& communicator, const Ice::StringSeq& args)
{
          communicator->setLogger(new MyCustomLoger());
}

is this correct? are a better way?

thanks in advantage

Comments

  • mes
    mes California
    Hi,

    Yes, that is a correct way to install the logger. In the default IceBox configuration, where each service has its own communicator instance, your code will only affect the communicator for this service.

    Take care,
    - Mark
  • matthew
    matthew NL, Canada
    Note that you can also use a plug-in to do the same thing. In your configuration file put a property such as:

    Ice.Plugin.Logger=Logger,0.0.1:create

    Then write a custom plug-in that creates a logger and registers it with the communicator. You can see the Ice manual for more information on custom plug-ins.