System Administration
Monitoring

Log Monitoring

Contact Support for assistance before altering the system logging configuration in the rolehostd.conf file.

The logs events using these severities:

  • Error
  • Warn
  • Info
  • Verbose
  • Debug
  • Extended Debug

By default, the data warehouse creates the text log file /var/opt/ocient/rolehostd.log and logs events at the Info level and above.

Database logging supports extensive customization and integration with third-party tools. You can customize using the rolehostd config file. The database can return events in text, JSON, or Extended Log Format (GELF) formats, or the database can return events in a file, to standard output (stdout), or to a UDP port. You can customize based on the log source.

Log Formats

The default log format is text. These are some example log entries.

Text


Each log line contains the time, severity, thread, and the source of the log (for example, roleHost or host).

JSON-formatted logs contain the same information but in a structured format.

JSON


GELF-formatted log entries follow the format defined on the GELF via UDP page. This is an example GELF format.

JSON


The database always returns message content in the short_message field of the GELF format.

This table maps Ocient severities to GELF system log (syslog) severities.

Ocient Severity

Syslog Severity

Syslog Numeric Value

Error

Error

3

Warn

Warning

4

Info

Notice

5

Verbose

Info

6

Debug and Extended Debug

Debug

7

Log Appenders

A log appender is the destination for log entries. The database can send log entries to a file, a UDP port, or to stdout.

When logs are sent to the file appender, they grow continuously unless you use the truncate option in the configuration. You can use tools such as logrotate to manage log files.

This is a sample logrotate configuration.

Text


Test the UDP appender using the netcat command.

Linux


Log Configuration

An Ocient System supports various logging settings to meet different needs.

Set log configuration settings in rolehostd.conf, a YAML file normally found in the system /var/opt/ocient/ directory. You can change configuration settings to suit your system logging needs in this file.

For information on checking the status of nodes, see Statistics Monitoring.

If you are using an Ocient Simulator, logging behavior and directories might differ from these descriptions.

For details on how logging works in the Ocient Simulator, see Simulator Logging.

rolehostd Example

This is an abbreviated rolehostd.conf example in YAML format. Normally, this file contains other system configurations, but this tutorial focuses on the loggingConfig section, which defines logging behaviors and scopes.

YAML


Scope Definition

The top level of the logging configuration is the scope, which determines the corresponding log sources for each configuration setup.

Default Scope

An empty scope string ('') applies its configuration settings to all log entries the system returns.

Named Scopes

Named scopes apply to log entries where the first component matches the name. Useful scopes include:

  • query — Contains information on all queries and statements executed on the system, including users, time, and other details.
  • security — Contains information on all connections made to the system, successful or unsuccessful.
  • dump — Contains information on system failures.

allowLevel

The allowLevel parameter specifies which severity levels of logs to capture.

YAML


Severity value definitions are:

  • debug — Most verbose (includes all logs). 
  • info — Includes informational messages and greater severities. 
  • verbose — More verbose than the info severity.  
  • warn — Includes warnings and errors only. 
  • error — Includes only error messages. 

appender

Appenders define the format and directory where the database sends log files. You can configure either one or many appenders for each scope.

Single Appender

For a single appender, use the appender key.

YAML


Multiple Appenders

For multiple output destinations, use the appenders key, followed by a list of appender keys.

YAML


format

Defines the output format of the log files of an appender.

YAML


Supported format_type values are:

  • text — Human-readable text format (default). 
  • json — Structured JSON format.
  • gelf — GELF format for integration with Graylog.

logFilePath

Defines the destination directory for log files of the appender. The directory value is a file path for the appender log files, for example: /path/to/rolehostd.log.

YAML


type

Determines whether the system submits error logs through stdout or to a separate server using a TCP or UDP protocol.

YAML


server

Required for TCP or UDP types.

The destination DNS name or IP address where the database sends log entries.

YAML


port

Required for TCP or UDP types.

The port where the database sends log entries. The default value is 9000.

YAML


chunkSize

Optional for UDP type.

The largest packet size in bytes that the system sends to the server. The database discards log entries larger than this value.

YAML


compressed

Optional for UDP type.

If you set this option to true, the system compresses packets. For details about log compression, see the GELF documentation. Otherwise, the packets are uncompressed.

YAML


truncate

If you set this option to true, the system truncates the log file when the system starts. Otherwise, the system appends new logs to the file. The default value is false.

YAML


Related Links