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

Feature request: Configuration of logging #246

Closed
we3geeks opened this issue Feb 4, 2024 · 7 comments
Closed

Feature request: Configuration of logging #246

we3geeks opened this issue Feb 4, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@we3geeks
Copy link

we3geeks commented Feb 4, 2024

Consider adding configuration options to have logging go to a file, with the location and name of the file also configurable.

I've used Mailpit through Homebrew and can do this as part of the startup command with redirection of stdout to a file of my choice. I've switched to running Mailpit via Docker with the mail database file on a Docker-mounted volume; I'd like to have the logging output go to a file on that same Docker-mounted volume.

@axllent axllent added the enhancement New feature or request label Feb 4, 2024
@axllent
Copy link
Owner

axllent commented Feb 4, 2024

Thanks for the suggestion, I am sure this can be added as a new feature. When you say "options" (plural), what options other than a file name are you suggesting?

In the interim, docker logs can be viewed with docker logs <container>, not to mention that you can probably redirect Mailpit logs to a file within docker too simply by adding that to your docker commands.

@we3geeks
Copy link
Author

we3geeks commented Feb 5, 2024

Apologies; poor choice of wording on my part. Having an option to specify a file with path (similar to the mail database option) would be sufficient.

@axllent
Copy link
Owner

axllent commented Feb 5, 2024

@we3geeks Awesome, thanks for the clarification - I'll see what I can do 👍

@axllent
Copy link
Owner

axllent commented Feb 5, 2024

I've added this feature in v1.13.2 (using --log-file <filepath> or the MP_LOG_FILE=<filepath> environment variable). The log formatting is somewhat different to the default stdout logging, but this format makes more sense for a physical logfile.

Please let me know if this works for you?

@we3geeks
Copy link
Author

we3geeks commented Feb 6, 2024

Looks great! Thanks for the quick turnaround on this.

@axllent
Copy link
Owner

axllent commented Feb 6, 2024

Excellent, you're welcome. I'll take that as "it's tested and working" and close this, however feel free to re-open if there is an issue.

@axllent axllent closed this as completed Feb 6, 2024
@we3geeks
Copy link
Author

we3geeks commented Feb 6, 2024

Yes, tested and working as expected.

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