Logging in a Standalone Service
You also use the Web service logger for logging from within a standalone server. A standalone service is deployed independent from the Agent and is created by generating service code using the -standalone option. This option results in the generation of a sample server, MyServiceServer.cpp in the app\server directory. Implement logging in this file. For more information on standalone servers in general, please see Standalone Server Implementations.
Logging from a standalone server is similar to logging from within client code, with the additional step of defining a logging element in the <servicecontextname>_handlers.xml file which can then be loaded and defined in the standalone server just as in the client. Note that logging is not generated by default in a standalone server implementation.
For example, if you were to generate a standalone server for the example DayofWeek, the app\server directory would contain a DayOfWeekPortServer.cpp file.
To implement logging for the DayofWeek standalone server:
1. Define the logger in the generated dayofweek_handlers.xml, similar to that defined in the client-handlers.xml file.
2. Load it and invoke it from the DayofWeekPortServer.cpp file.
These steps are exactly the same as those for the client, described in detail in Configuring and Using a Client Logger.