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

basti: Add option to save logs #62

Open
bobveringa opened this issue Aug 2, 2023 · 2 comments
Open

basti: Add option to save logs #62

bobveringa opened this issue Aug 2, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@bobveringa
Copy link
Contributor

Feature Description

The Basti CLI currently only logs to the terminal. This issue proposes a solution that would allow logging to log file.

A logging config option would allow users to specify a file or location (or a default location would be used otherwise) where the Basti CLI would log its activity. This would be beneficial for a number of reasons, including:

  • Troubleshooting problems: If the Basti CLI encounters a problem, the log file could be used to track down the cause of the problem and to identify any errors that may have occurred.
  • Auditing: The log file could be used to audit the activity of the Basti CLI and to ensure that it is being used in a secure and compliant manner.

Proposed Solution

Building on issue #59 it would make sense to create a .config.yml (or json) file in this ~/.basti directory. This would then have a section for logging.

logs:
  save_logs: true
  log_line_limit: 1000
  save_location: ~/.basti/logs/

save_logs would enable or disable logging to a file
log_line_limit is intended to limit the size of the file. This avoids log files that end up GB's in size.
save_location allows the user to configure a save location, but default this is stored in the ~/.basti directory.

The logging itself should always be prefixed with a timestamp. This helps with troubleshooting events in time and allows you to check with AWS logging as well.

Initially, I'd recommend that these settings can just be modified through the config.yml file, but later a command could be added that changes these settings. basti config logs.save_logs true for example.

Related Issues/PRs

#59

@BohdanPetryshyn
Copy link
Collaborator

In order for such logging to be more useful, we also need to add more debug/trace logs to Basti CLI.

@bobveringa
Copy link
Contributor Author

More logging would be nice. But it would already be great if what is currently displayed on the terminal is stored in a log file with a timestamp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants