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

Persist Logs on container restart #3661

Open
coderbirju opened this issue Nov 8, 2024 · 1 comment
Open

Persist Logs on container restart #3661

coderbirju opened this issue Nov 8, 2024 · 1 comment
Labels
area/logging bug Something isn't working

Comments

@coderbirju
Copy link
Contributor

coderbirju commented Nov 8, 2024

What is the problem you're trying to solve

In nerdctl, logs are not persisted when containers are restarted or recreated. This behavior is observed in the following scenarios:

  • Using nerdctl run followed by nerdctl start -a
  • Using nerdctl restart
  • Using nerdctl create followed by nerdctl start and nerdctl restart
    In all these cases, only the most recent logs are available after a container restart or recreation.

Describe the solution you'd like

nerdctl should log persist logs similar to Docker and Podman.

Specifically:
Logs should be preserved across container restarts.

When using nerdctl start -a on a previously run container, both old and new logs should be accessible.
The nerdctl restart command should not replace previous logs but append new ones.
Containers created with nerdctl create and then started should maintain their logs across multiple starts.

Additional context

No response

@coderbirju
Copy link
Contributor Author

So it seems that go-logrotate has a bug when MaxBytes is set to -1 and rotates the logs for every re-invocation. creating another log file with a .1 suffix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/logging bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants