class Locd::CLI::Command::RotateLogs
Manage log rotation.
Definitions
¶ ↑
Public Class Methods
Public Instance Methods
add()
click to toggle source
# File lib/locd/cli/command/rotate_logs/add.rb, line 26 def add agent = agent_class.add **option_kwds( groups: [ :write, :add ] ) logger.info "#{ agent_class.name } `#{ agent.label }` created." agent.reload if options[:load] respond agent end
plist()
click to toggle source
# File lib/locd/cli/command/rotate_logs.rb, line 99 def plist if options[:json] || options[:yaml] respond agent.plist else respond agent.path.read end end
restart()
click to toggle source
# File lib/locd/cli/command/rotate_logs.rb, line 135 def restart agent.restart **option_kwds( :write, groups: :stop ) end
run_()
click to toggle source
# File lib/locd/cli/command/rotate_logs.rb, line 88 def run_ Locd::Newsyslog.run_all end
start()
click to toggle source
# File lib/locd/cli/command/rotate_logs.rb, line 113 def start agent.start **option_kwds( :write ) end
stop()
click to toggle source
# File lib/locd/cli/command/rotate_logs.rb, line 124 def stop agent.stop **option_kwds( :unload, groups: :stop ) end
Protected Instance Methods
agent()
click to toggle source
find_multi!(pattern;)
click to toggle source
# File lib/locd/cli/command/rotate_logs.rb, line 73 def find_multi! pattern; [ agent ]; end
find_only!(pattern;)
click to toggle source
# File lib/locd/cli/command/rotate_logs.rb, line 71 def find_only! pattern; agent; end