Log Service
The LogService interface enables you to:
Configuring LogService
You can control the log size by setting the org.servicetango.service.log.size system property.
This can be done by putting the following lines in the servicetango.xml configuration file and
substituting values that you prefer for the shown values:
The LogService takes log requests from bundles and the LogReaderService allows
other bundles to read entries from the log. You can specify that the LogService
log messages at one of four specified levels: Error, Warning, Info, or Debug.
The LogService is intended to report errors, although you can log any message.
The LogReaderService interface enables you to:
Specify the message or exception or both to be logged.
Supply a log level signifying the severity of the log message.
Specify the service that is associated with the log requests.
Bundles can make log requests through LogService after they get the Service
object from the Framework. LogService can log a simple message at the specified
log level, and it can also log a message with an exception at the specified log
level.
Retrieve recent past log entries.
Receive notification of new log entries.
<system-property>
<name>org.servicetango.service.log.size</name>
<value>20</value>
</system-property>
Note that the configurations described here are specific to the
implementation of LogService that is included in ServiceTango.
For more detailed information about methods for the LogService, see the
OSGi API specification.
HttpService
When a bundle registers a service or resource, it must provide an HttpContext object.
The HttpContext object provides methods that HttpService calls to get information about a registration.
For example, resources that are registered might require a special MIME type or authentication.
Servlets that are registered with the same HttpContext object share the same ServletContext.
Servlets can be registered using the registerServlet method.
Resources can be registered using the registerResource method.
Configuring HttpService
You can control the port, protocol, and hostname used by the HTP service by
putting the following lines in the servicetango.xml configuration file and
substituting values that you prefer for the shown values:
For more specific information about the HttpService API, see the OSGi API specification.
The HttpService is an HTTP 1.0 Web server with a Java 2.2 servlet engine with support for and JavaServer Pages 1.1.
The HttpService enables other bundles to dynamically register and unregister servlets and other static resources such as GIF files.
You can register HTML files, GIF files, class files, or any resources that can be read through a URL.
Note that the configurations described here are specific to the
implementation of LogService that is included in ServiceTango.
<system-property>
<name>org.servicetango.service.http.port</name>
<value>8080</value>
</system-property>
<system-property>
<name>org.servicetango.service.http.protocol</name>
<value>http</value>
</system-property>
<system-property>
<name>org.servicetango.service.http.hostname</name>
<value>fahwt</value>
</system-property>