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.
The default log format is text. These are some example log entries.
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.
GELF-formatted log entries follow the format defined on the GELF via UDP page. This is an example GELF format.
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 |
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.
Test the UDP appender using the netcat command.
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.
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.
The allowLevel parameter specifies which severity levels of logs to capture.
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.
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.
Multiple Appenders
For multiple output destinations, use the appenders key, followed by a list of appender keys.
Defines the output format of the log files of an appender.
Supported format_type values are:
- text — Human-readable text format (default).
- json — Structured JSON format.
- gelf — GELF format for integration with Graylog.
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.
Determines whether the system submits error logs through stdout or to a separate server using a TCP or UDP protocol.
server
Required for TCP or UDP types.
The destination DNS name or IP address where the database sends log entries.
port
Required for TCP or UDP types.
The port where the database sends log entries. The default value is 9000.
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.
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.
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.