Provides Information about the OSGi Remote Log Service.

Remote Log Service

The Remote Log Service registers a log listener with the OSGi Log Reader Service available on the device. When the Remote Log Service receives a new message, it redirects the message to the corresponding management server where they are stored. The log levels of interest are defined via a configuration property as described in "Configuring the Device Log Agent Bundle" below.
The Remote Log Service can work in reliable mode, that is log messages which are generated when a device is not connected to the RM system are sent when it connects. This mode makes reading device-generated logs more reliable as such logs may not be stored successfully on the management server. They are lost at the time they are created if there is no connection to the management server, or by another reason log messages do not reach their target. In reliable mode the Remote Log Service stores locally generated logs before sending them to the management server and deletes them after the management server has confirmed message storage. To be able to use this mode, the managed device must have a local file system. The reliable mode is turned on/off with a configuration property (see "Configuring the Log Agent Bundle" below).

Remote Log Extension Service

There is another remote log service – Remote Log Extension Service, which is useful when the target device runs the OSGi Log Service implemented by the Gateway Software. The Gateway Software Log Service is able to store log message in files. On request, the Remote Log Extension Service redirects the content of these log files to the backend. Therefore, applications running on or connected to the backend can access Gateway Software log files.

Log messages storage feature of the Gateway Software Log Service must be on to make use of the Remote Log Extension Service. 


To access logs on a device it is reasonable to use either the Remote Log Service or the Remote Log Extension Service. On the one hand with Remote Log Service you automatically have all latest log information even if the device is off. On the other hand, the use of the Remote Log Extension Service lowers the traffic of log information between the devices and the backend (the management server), but if the device crashes it will not be possible to get the device logs and search them for the cause of the crash.

Log messages which are generated on managed devices before installing and starting the Remote Log Service are not visible to the RM backend.


If you do not activate the Remote Log Service, you will still be able to obtain device-related logs generated by the backend. The Remote Log Service is responsible only for the logs created locally on the device. 

Log Monitor

The Log Monitor delivers functionality for sending "urgent" device-generated log messages to the RM backend, when the managed device is offline. If error log messages, with a specified log level occur, they are sent immediately by the Remote Log Service, as the Log monitor opens the connection between the RM and the managed device.
The specified log level is determined by the system property mprm.log.threshold. This property holds an integer value indicating the weakest requirement for the log level. All logs of level equal or less than the specified value, trigger such a connection.
To ensure the receiving of "urgent "log messages on the backend, you must turn ensuredStorage configuration property (see "Configuring the Log Agent Bundle" section below) to true.

Installation and Setup

If you want to enable device-generated logs, on the managed device you need the Remote Log Service, Remote Log Extension Service or log monitor.

  1. To start the Remote Log Service, an OSGi Log Service must be registered. The Remote Log Extension Service is useful only with the Log Service implementation by Bosch Digital .
  • If you are to use the Remote Log Service, you need the Device Log Agent bundle (osgidm.log.agent.jar from packages/osgidm) running on the target device.
  • If you are to use the Remote Log Extension Service, you need the Device Log Files Agent bundle (osgidm.log.files.agent.jar from packages/osgidm) running on the target device.
  • If you are to use the log monitor, you need the Device Log Monitor Agent bundle (osgidm.log.monitor.agent.jar from packages/osgidm) running on the target device.

There are three ways to deploy the preferred log agent:

  1. When you register a new device in RM through the console – By selecting the correspondent optional feature in the Register OSGi Device wizard. In the Optional Administration Features dialog specify one of the following:

Remote Log Service option for the log agent
Remote Log Extension Service one for the log extension agent.
Log Monitor option for enabling the log monitor agent.

  1. On an already registered device – By installing through the console the Device Log Agent, Device Log Files Agent or Device Log Monitor Agent bundle from the RM software repository.
  2. Manually – By installing the appropriate bundle JAR file.

Configuring the Device Log Agent Bundle

The Device Log Agent bundle (osgidm.log.agent.jar) can be configured through the OSGi Configuration Admin Service. It registers an org.osgi.service.cm.ManagedService with a PID: prm.logagent.pid. The Device Log Agent bundle has the following configuration properties:

Property

Default Value

Description

Log Levels

1;2;3;4;

Defines the log levels that will be sent to RM. The default value indicates that all four levels will be sent to the backend. Note: If there are user-defined log levels, you can add them to the value of this property. You can also specify * as a value of this property. This will allow all logs to be sent to the backend ignoring their log levels.

Ensured Storage

Yes

Switches on and off the reliable mode of log persistent storage.

Include source information

No

Enables the retrieval of the logs sources, that is, the bundles which had generated the logs. Note: When this property is enabled, the performance of the entire system decreases dramatically.

Filter log message that starts with

*

Enables filtering of logs, which start with certain word or expression.

Filter log message that contains

*

Enables filtering of logs, which contain certain word or expression.

Period

0

The period of time (in seconds) after which the timer is removing expired logs from the data structure containing recent logs.

Skip Duplicated Logs

false

Skip or not sending the received in predefined period duplicated logs.

Skip Interval

60

During this interval (in seconds) the received duplicated logs are skipped.

Capacity

100

Maximum capacity of the data structure containing recent logs.

The log agent configuration is available under the Configurations node of the managed OSGi device:

User Interface

The console provides a user interface for reading log messages generated on a specific managed device when using either the Remote Log Service or the Remote Log Extension Service. For details see Retrieving Logs from OSGi Devices document from the User' Guide.

Log Service API

On the target device, developers can use the OSGi Log Service to create log messages. On the backend for reading device-generated logs, the Log Reader Service is used. See System Package Programmer's Guide for details on using the Log Reader Service.