Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend Default Log Lines and Add Verbose Option for kamal deploy #536

Closed
jmarsh24 opened this issue Oct 18, 2023 · 3 comments
Closed

Extend Default Log Lines and Add Verbose Option for kamal deploy #536

jmarsh24 opened this issue Oct 18, 2023 · 3 comments

Comments

@jmarsh24
Copy link

jmarsh24 commented Oct 18, 2023

Description:

The kamal deploy command currently caps the logs at 50 lines by default. For many deployments or intricate error scenarios, this limited view can be insufficient to diagnose issues. It would be beneficial to extend the default log lines and also provide a "verbose" flag for detailed logging.

Proposed Solution:

  1. Change the default number of log lines to 200 for kamal deploy.
  2. Introduce an optional flag to specify the number of log lines:
    • --log-lines=<number> or a shorter version -l <number>
  3. Add a "verbose" option with the flag -v to show detailed logs.

Example:

  • To view the last 150 lines of logs:

    kamal deploy --log-lines=150
    

    OR

    kamal deploy -l 150
    
  • For verbose logging:

    kamal deploy -v
    

Rationale:

  • Provide a more comprehensive default view for better diagnosis right off the bat.
  • The "verbose" option can give users an in-depth look when needed, enhancing troubleshooting capabilities.
  • Align with conventions and best practices in the industry, where -v often denotes verbose output.

Additional Context:

The increased default of 200 lines and the verbose option would enhance the tool's flexibility and effectiveness, especially in complex deployment scenarios.

https://gist.github.com/jmarsh24/fc92b7740279e4e0cf7d3faa64dda1aa

This is an example where the health check failed and swallowed the error that an environment variable was missing. After manually increasing the log_lines I was able to see what the error was to address it.

 ERROR [1] Puma starting in cluster mode...
[1] * Puma version: 6.4.0 (ruby 3.2.2-p53) ("The Eagle of Durango")
[1] *  Min threads: 5
[1] *  Max threads: 5
[1] *  Environment: production
[1] *   Master PID: 1
[1] *      Workers: 1
[1] *     Restarts: () hot () phased
[1] * Preloading application
W, [2023-10-17T21:25:54.016952 #1]  WARN -- : DEPRECATION WARNING: Card options parameter is deprecated in favor of arguments parameter and will be removed from Avo version 3.0.0
W, [2023-10-17T21:25:54.017296 #1]  WARN -- : DEPRECATION WARNING: Card options parameter is deprecated in favor of arguments parameter and will be removed from Avo version 3.0.0
W, [2023-10-17T21:25:54.017337 #1]  WARN -- : DEPRECATION WARNING: Card options parameter is deprecated in favor of arguments parameter and will be removed from Avo version 3.0.0
W, [2023-10-17T21:25:54.017369 #1]  WARN -- : DEPRECATION WARNING: Card options parameter is deprecated in favor of arguments parameter and will be removed from Avo version 3.0.0
W, [2023-10-17T21:25:54.017396 #1]  WARN -- : DEPRECATION WARNING: Card options parameter is deprecated in favor of arguments parameter and will be removed from Avo version 3.0.0
[1] ! Unable to load application: Shimmer::Config::MissingConfigError: BASE_URI environment value is missing
bundler: failed to load command: puma (/usr/local/bundle/ruby/3.2.0/bin/puma)
/usr/local/bundle/ruby/3.2.0/gems/shimmer-0.0.31/lib/shimmer/utils/config.rb:22:in `method_missing': BASE_URI environment value is missing (Shimmer::Config::MissingConfigError)
@Sija
Copy link
Contributor

Sija commented Dec 21, 2023

Showing the last N lines might be even more helpful (considering given example).

@mazaleyrat
Copy link

mazaleyrat commented Jan 6, 2024

Thanks @jmarsh24 Agreed :) Having the same problem, how did you manage to increase the log_lines manually ?

Answer: just drop in your deploy.yml something like
healthcheck: log_lines: 10_000 max_attempts: 7

@djmb
Copy link
Collaborator

djmb commented Mar 6, 2024

This is configurable since #444

@djmb djmb closed this as completed Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants