VIRGO supports logging and storing the log information in a file and posting it to a DTP or HTTP URL. Logging is by default disabled. Logging is turned on by sending a log section as part of a configuration message which contains at least a lease date, log deposit URL and a dictionary which stores the desired log levels. The following code block shows an example of a log section which enables logging for the package ‘tracking’ across all feeds:
{
...
"log": {
"lease-date": 12716,
"deposite-url": "http://object-server.real.com/virgo-logs"
"deposite-interval": 12000
"levels": {
"tracking": "d"
}
},
...
}
A log section must contain a lease date which is greater than the lease date currently stored by virgo to enable logging. VIRGO enables logging for up to 1 minute. VIRGO automatically disables logging for all log packages after one minute. A new lease date must be sent periodically to allow logging to continue uninterrupted.
VIRGO automatically disables logging after one minute in order to guarantee that logging will not accidentally stay turned on even if the connection to the VIRGA server or the local VIRGO command line tool is lost.
A log level inside the “levels” dictionary is expressed as a mapping from a log package name to a log level. Log package names may optionally be scoped to a feed:
# Enable debug level logging for the 'tracking' package on a global level which means that logging will happen for all existing and future feeds.
"tracking": "d"
# Enable debug level logging for the 'tracking' package for the feed with the name "foo" only. Other feeds will not generate log statements for this log package.
"tracking.foo": "d"
See Service Logging for a list of all supported log packages and log levels.
VIRGO delivers the log statements to the deposit URL as a JSON array of log statements. The JSON array contains all log statements that have been generated since the last time a log deposit operation was executed. A log statement is a single line of text which is organized into individual fields separated by a tab character. The line is terminated by a newline character. The structure looks like this:
<time>\t<level>\t<tag>\t<message>\n
where:
Field | Type | Description |
---|---|---|
time | EpochTime | The time when the log line was generated. |
level | String | The log level. See Service Logging for a list of supported log levels. |
tag | String | The log package name. See Service Logging for a list of supported log package names. If the log statement was generated by a specific feed then the feed name is appended to the tag and the package and feed components are separated by a single dot. E.g. if a feed “foo” generates a log statement for the package “tracking” then the tag would be “tracking.foo”. |
message | String | The log message. |
The following code block shows an example of a log deposit:
[
"567567\td\ttracking.camera_1\t...\n",
"567590\td\ttracking.movie\t...\n",
...
]
The following HTTP headers are included with every log deposit POST request:
Header | Description |
---|---|
X-CLIENT-ID | The client id of the virgod instance. This is immutable, factory configured, unique and descriptive vrgo instance identifier. For example: VRGO-LNX-TRPR-16-123 |
X-CLIENT-TYPE | The type of the client. This is a combination of the client name and the platform name. For example: Virgo-Linux |