Class: Locd::Agent::RotateLogs

Inherits:
Job show all
Includes:
System
Defined in:
lib/locd/agent/rotate_logs.rb

Overview

An server Locd::Agent (HTTP only at the moment) that the proxy can route requests to.

Constant Summary

Constants inherited from Locd::Agent

TO_H_NAMES

Instance Attribute Summary

Attributes inherited from Locd::Agent

#path, #plist

Class Method Summary collapse

Methods included from System

class_for, classes, included, label?, plist?

Methods inherited from Job

create_plist_data, plist?

Methods inherited from Locd::Agent

#<=>, add, add_or_update, all, class_for, #cmd_template, #config, create_plist_data, default_log_path, #default_log_path?, #err_path, exists?, find_all, find_all!, find_only!, from_path, get, #initialize, #label, labels, #last_exit_code, #load, #log_paths, #out_path, #pid, plist?, plist_abs_path, plists, #reload, #remove, render_cmd, resolve_log_path, #restart, #running?, #start, #status, #stop, #stopped?, #to_h, #to_json, #to_yaml, #unload, #update, user_plist_abs_dir, #workdir

Constructor Details

This class inherits a constructor from Locd::Agent

Class Method Details

.default_cmd_templateString

Not much to explain here.

Returns:

  • (String)


55
56
57
# File 'lib/locd/agent/rotate_logs.rb', line 55

def self.default_cmd_template
  "{bin} rotate-logs run"
end

.default_start_intervalObject



60
61
62
# File 'lib/locd/agent/rotate_logs.rb', line 60

def self.default_start_interval
  NRSER.deep_symbolize_keys Locd.config[:rotate_logs, :start_interval]
end

.default_write_kwds(cmd_template: self.default_cmd_template, start_interval: self.default_start_interval, **kwds) ⇒ Object

Patch in default_cmd_template as, well, the default for cmd_template.

Parameters:

  • cmd_template: (String | Array<String>) (defaults to: self.default_cmd_template)

    Template for the string. Arrays are just rendered per-entry then joined.

  • **kwds

    Merged into the returned Hash.



73
74
75
76
77
78
79
80
# File 'lib/locd/agent/rotate_logs.rb', line 73

def self.default_write_kwds cmd_template: self.default_cmd_template,
                            start_interval: self.default_start_interval,
                            **kwds
  super \
    cmd_template: cmd_template,
    start_interval: start_interval,
    **kwds
end

.label_nameString

Returns The non-namespace part of the log rotator agent's label.

Returns:

  • (String)

    The non-namespace part of the log rotator agent's label.



46
47
48
# File 'lib/locd/agent/rotate_logs.rb', line 46

def self.label_name
  "rotate_logs"
end