[GH-ISSUE #246] Feature request: Configuration of logging #160

Closed
opened 2026-03-15 12:55:20 +03:00 by kerem · 7 comments
Owner

Originally created by @we3geeks on GitHub (Feb 4, 2024).
Original GitHub issue: https://github.com/axllent/mailpit/issues/246

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.

Originally created by @we3geeks on GitHub (Feb 4, 2024). Original GitHub issue: https://github.com/axllent/mailpit/issues/246 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.
kerem 2026-03-15 12:55:20 +03:00
Author
Owner

@axllent commented on GitHub (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.

<!-- gh-comment-id:1925884091 --> @axllent commented on GitHub (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.
Author
Owner

@we3geeks commented on GitHub (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.

<!-- gh-comment-id:1926196268 --> @we3geeks commented on GitHub (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.
Author
Owner

@axllent commented on GitHub (Feb 5, 2024):

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

<!-- gh-comment-id:1926205729 --> @axllent commented on GitHub (Feb 5, 2024): @we3geeks Awesome, thanks for the clarification - I'll see what I can do :+1:
Author
Owner

@axllent commented on GitHub (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?

<!-- gh-comment-id:1926579629 --> @axllent commented on GitHub (Feb 5, 2024): I've added this feature in [v1.13.2](https://github.com/axllent/mailpit/releases/tag/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?
Author
Owner

@we3geeks commented on GitHub (Feb 6, 2024):

Looks great! Thanks for the quick turnaround on this.

<!-- gh-comment-id:1928724979 --> @we3geeks commented on GitHub (Feb 6, 2024): Looks great! Thanks for the quick turnaround on this.
Author
Owner

@axllent commented on GitHub (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.

<!-- gh-comment-id:1928859393 --> @axllent commented on GitHub (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.
Author
Owner

@we3geeks commented on GitHub (Feb 6, 2024):

Yes, tested and working as expected.

<!-- gh-comment-id:1929344927 --> @we3geeks commented on GitHub (Feb 6, 2024): Yes, tested and working as expected.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#160
No description provided.