Reverbrain wiki

Site Tools


elliptics:api-logging

Logging

Elliptics (since 2.26 version) uses blackhole logging library for writing logs. Elliptics can output logs in a file, in syslog or in a TCP or UDP socket. On client-side blackhole logger could be customised and passed as an argument to elliptics node constructor.

Logs rotation

Blackhole reopens log file each time when the origin file has been moved or removed. This behaviour could be used for logs rotation: some external tool could move/archive the log file, and blackhole will start new log file by the original path.

Reading the logs

All Elliptics logs has follow format:

%timestamp% %trace_id%/%thread_id%/%process_id% %LOG_LEVEL%: %log message%

%timestamp% - is a timestamp of a log record. It has follow format:

YYYY-mm-dd HH-MM-SS.f

%trace_id% - any transaction or set of transactions on client-side could be marked by trace_id. All logs that connected with marked transactions will have corresponding trace_id. Trace_id could be set via session method set_trace_id. Also you could set trace_bit to make logger writes all logs with ignoring log_level from the config. Trace_bit could be set via session method set_trace_bit.
%thread_id% - id of the thread that produced the log. %process_id% - id of the process that produced the log. %LOG_LEVEL% - string log level of the log record. It could be one of: ERROR, WARNING, INFO, NOTICE or DEBUG.

elliptics/api-logging.txt ยท Last modified: 2014/10/06 20:51 by shaitan