Class: Pvectl::Commands::Logs::Handlers::Syslog

Inherits:
Object
  • Object
show all
Includes:
ResourceHandler
Defined in:
lib/pvectl/commands/logs/handlers/syslog.rb

Overview

Handler for node syslog output.

Fetches syslog entries from a node via Repositories::Syslog. Supports filtering by service name and time range.

Examples:

Using via registry

handler = Logs::ResourceRegistry.for("node")
entries = handler.list(node: "pve1", service: "pvedaemon")

See Also:

Instance Method Summary collapse

Constructor Details

#initialize(repository: nil) ⇒ Syslog

Returns a new instance of Syslog.



22
23
24
# File 'lib/pvectl/commands/logs/handlers/syslog.rb', line 22

def initialize(repository: nil)
  @repository = repository
end

Instance Method Details

#list(node:, limit: 50, since: nil, until_time: nil, service: nil, **_) ⇒ Object



26
27
28
29
# File 'lib/pvectl/commands/logs/handlers/syslog.rb', line 26

def list(node:, limit: 50, since: nil, until_time: nil, service: nil, **_)
  repository.list(node: node, limit: limit, since: since,
                  until_time: until_time, service: service)
end

#presenterObject



31
32
33
# File 'lib/pvectl/commands/logs/handlers/syslog.rb', line 31

def presenter
  Presenters::SyslogEntry.new
end