Adapter Logging

The Reuters Marketfeed adapter supports the same options for logging as the Event Stream Processor.

The -d option sets the debug level (0=emergency messages only, 7=all messages).

The -l option tells the adapter to write log messages to stderr, syslog, both, or neither. If you use the -l option to direct adapter log messages to stderr, you may also want to redirect stderr to a file.

The name attribute of the publication element in the input adapter map file specifies a descriptive text string that is logged to help identify how the adapter was configured. For example, lines 3–6 of subexample.xml specify the publication element for a subscribing instance of the Reuters Marketfeed adapter, as follows:

<publication
    name="RMDS Adapter exp"
    retryInterval="5"
/>

As the adapter connects with and interacts with Event Stream Processor, this configuration causes the adapter to write log messages similar to:

(0.123) @1 INFO: Configuring publication with name RMDS Adapter exp

The first two fields are the timestamp (in seconds since start-up) and the thread number, respectively. The base time for the timestamp, along with other information, is written to the log file on start-up as shown in the following example. To convert the timestamp to a date and time, simply add the number of seconds to the base time.

(63359098041.768) @1 NOTICE:Base time is 10/08/08-17:27:21
(0.001) @1 NOTICE:insta-a sub -c cimtest:-- -d 7
-f /home/sybase/support/1.0.3/ReutersAdapter/quotes.map.xml
-l 1 -p tigris:12192 -P 1
(0.001) @1 NOTICE:pid=28649
(0.001) @1 DEBUG:Using ESP_RMDS_SUBSCRIBE_DEBUG_LEVEL=7ll/i86pc_64_spro/bin/rmds version:
1.0.3a-alpha_r18674M

Page Data and Partial Page Updates

Some Reuters data comes as pages which use Marketfeed partial format. Each page consists of multiple lines; initially sent as a snapshot. Page data is supported without any special configuration. The following extract from an adapter log file shows the delivery of the initial page image (which is displayed).

(27.729) @6 INFO:Publishing VOD.mGBPd 21 of 21 on stream1 as UPSERT
_ITEM_NAME_ STRING: VOD.mGBPd
_SERVICE_NAME_ STRING: IDN_RDF
_SEQUENCE_NUMBER_ INTEGER: 1
_ITEM_STALE_ INTEGER: 0
ROW80_1 STRING: VOD.mGBPd SI Quote Publication
ROW80_2 STRING:
ROW80_3 STRING: DATE:03/07/2008 Time:11:09
ROW80_4 STRING:
ROW80_5 STRING: Time Venue SI Bid Size Bid Price Ask Price Ask Size Status
ROW80_6 STRING: ==== ===== == ======== ========= ========= ======== ======
ROW80_7 STRING: 110937 GSILGB2XXXX GSIL 1 150.9000 150.9500 1 OPEN
ROW80_8 STRING: 070021 SBILGB2LXXX CITI OPEN
ROW80_9 STRING: 110909 CSFBGB2LXXX CSFB 329 150.7000 151.1500 329 OPEN
ROW80_10 STRING: 110942 DEUTGB22ZEQ DBBL 528 150.6500 151.2000 527 OPEN
ROW80_11 STRING: 110946 ABNAGB22XXX ABNV 483306 150.9000 150.9500 483306 OPEN
ROW80_12 STRING: 110936 UBSWGB2LEQU UBSI 1 149.7682 152.1325 1 OPEN
ROW80_13 STRING: 110828 SBUKGB21XXX CITI 20600 150.9000 151.0000 20600 OPEN
ROW80_14 STRING: 110937 SLIIGB2LXXX LEHM 3750 150.9000 150.9500 15 OPEN
ROW80_15 STRING:
ROW80_16 STRING:
ROW80_17 STRING:
(27.730) @6 DEBUG:Immediate flush for low latency; opcode=p

Each line of the page has its own FID to facilitate line-oriented deltas to the page. The adapter parses the partial page updates from Reuters and produces strings like the ones shown in the following extract from an adapter log file.

(49.934) @6 DEBUG:Processing update for VOD.mGBPd from service IDN_RDF
(49.934) @6 INFO:Publishing VOD.mGBPd 4 of 21 on stream1 as UPSERT
_ITEM_NAME_ STRING: VOD.mGBPd
_SEQUENCE_NUMBER_ INTEGER: 2
ROW80_3 STRING: off:78 size:2 value:10
ROW80_11 STRING: off:2 size:3 value:101
(49.934) @6 DEBUG:Immediate flush for low latency; opcode=p
(50.315) @6 DEBUG:Processing update for VOD.mGBPd from service IDN_RDF
(50.315) @6 INFO:Publishing VOD.mGBPd 3 of 21 on stream1 as UPSERT
_ITEM_NAME_ STRING: VOD.mGBPd
_SEQUENCE_NUMBER_ INTEGER: 3
ROW80_11 STRING: off:5 size:1 value:7
(50.315) @6 DEBUG:Immediate flush for low latency; opcode=p

The first update in the example is to write the 2-character string 10 at an offset of 78 characters in the line of the page which contains the data from the ROW80_3 FID. The second update in the example is to write the 3-character string 101 at an offset of 2 characters in the line of the page which contains the data from the ROW80_11 FID. The third update in the example is to write the 1-character string 7 at an offset of 5 characters in the line of the page which contains the data from the ROW80_11 FID. Thus, updates for page data are very concise.

Modifying Log Entry Format

You can modify the default format of log entries in two ways.

Set the environment variable ESP_RMDS_SUBSCRIBE_SYMBOL_FORMAT to 1 to configure your system to log messages that show what values flow to the Event Stream Processor on a single line rather than the default multi line format. When messages are written to a log file, this can make it easier to scan for specific items.

Use the -P option to the esp_rmds command to specify specify the number of decimal places that appear on output for double type variables.

By default, log messages that show what values flow to the Event Stream Processor are written in multi line format as shown.
(38079.526) @2 INFO:Publishing VOD.mGBPd 3 of 9 on stream1 as UPSERT
_ITEM_NAME_ STRING: VOD.mGBPd
_SEQUENCE_NUMBER_ INTEGER: 953
ROW80_7 STRING: off:53 size:2 value:45
If you set the environment variable ESP_RMDS_SUBSCRIBE_SYMBOL_FORMAT to 1 these messages are written are written in single-line format.
(17.794) @5 DEBUG:stream1 p values: _ITEM_NAME_=VOD.mGBPd _SEQUENCE_NUMBER_=2
ROW 80_3=off:78 size:2 value:20
The -P option can alter the manner in which double datatype variables appear, as shown by ask and last are in the following example. This affects only the way variables appear; it does not alter the contents.
<RowDefinition id="marketfeed_RowDef">
<Column name="symbol" datatype="string" />
<Column name="service" datatype="string" />
<Column name="seq" datatype="integer" />
<Column name="stale" datatype="integer" />
<Column name="bid" datatype="money" />
<Column name="ask" datatype="double" />
<Column name="last" datatype="double" />
<Column name="volume" datatype="integer" />
<Column name="when" datatype="timestamp" />
</RowDefinition>
If you accept the default precision, variables of type double (for example, ASK in the following example) are written with three digits to the right of the decimal
(5.089) @5 INFO:Publishing EURJPY= 7 of 9 on stream1 as UPSERT
(5.090) @5 DEBUG:stream1 p values: _ITEM_NAME_=EURJPY=
_SEQUENCE_NUMBER_=1 _ITEM_STALE_=0 BID=137.4800 ASK=137.530 ACVOL_1=0
ACTIV_DATE+TIMACT=2008-10-06T21:07:00.000 (1223327220000)
If you specify the option -P 7 when enter the esp_rmds command, variables of type double (for example, ASK in the following example) are written with seven digits to the right of the decimal. Variables of other types are not affected.
(4.913) @5 INFO:Publishing EURJPY= 7 of 9 on stream1 as UPSERT
(4.913) @5 DEBUG:stream1 p values: _ITEM_NAME_=EURJPY=
_SEQUENCE_NUMBER_=1 _ITEM_STALE_=0 BID=137.5200 ASK=137.5700000
ACVOL_1=0 ACTIV_DATE+TIMACT=2008-10-06T20:55:00.000 (1223326500000)