Module: Kamal::Commands::App::Logging
- Included in:
- Kamal::Commands::App
- Defined in:
- lib/kamal/commands/app/logging.rb
Instance Method Summary collapse
- #follow_logs(host:, timestamps: true, lines: nil, grep: nil, grep_options: nil) ⇒ Object
- #logs(version: nil, timestamps: true, since: nil, lines: nil, grep: nil, grep_options: nil) ⇒ Object
Instance Method Details
#follow_logs(host:, timestamps: true, lines: nil, grep: nil, grep_options: nil) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/kamal/commands/app/logging.rb', line 9 def follow_logs(host:, timestamps: true, lines: nil, grep: nil, grep_options: nil) run_over_ssh \ pipe( current_running_container_id, "xargs docker logs#{" --timestamps" if }#{" --tail #{lines}" if lines} --follow 2>&1", (%(grep "#{grep}"#{" #{}" if }) if grep) ), host: host end |
#logs(version: nil, timestamps: true, since: nil, lines: nil, grep: nil, grep_options: nil) ⇒ Object
2 3 4 5 6 7 |
# File 'lib/kamal/commands/app/logging.rb', line 2 def logs(version: nil, timestamps: true, since: nil, lines: nil, grep: nil, grep_options: nil) pipe \ version ? container_id_for_version(version) : current_running_container_id, "xargs docker logs#{" --timestamps" if }#{" --since #{since}" if since}#{" --tail #{lines}" if lines} 2>&1", ("grep '#{grep}'#{" #{}" if }" if grep) end |