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

verbose logging using docker image #56

Open
tszpinda opened this issue Jul 9, 2015 · 12 comments
Open

verbose logging using docker image #56

tszpinda opened this issue Jul 9, 2015 · 12 comments

Comments

@tszpinda
Copy link

tszpinda commented Jul 9, 2015

Loving the project!

Is there a way to make docker image not to print content of attachments into the logs? as it gets very verbose with bigger attachments.

@ian-kent
Copy link
Member

ian-kent commented Oct 6, 2015

Thanks @tszpinda

No configurable way of changing log output at the moment (from MailHog) - a temporary workaround would be to pipe the output to /dev/null or something like that.

I'll have a look at making MailHog log output a bit more configurable!

@mjsisley
Copy link

+1

@esiqveland
Copy link

Any news on this? It makes it very verbose when printing entire data contents of every email.

@ian-kent
Copy link
Member

Sorry for the delay - I'll get something done asap.

@fredleger
Copy link

+1
i used it as a production solution but the container is very agressive on cpu when priting every byte received in attachement ...

@talawahtech
Copy link

FYI, this is the docker ENTRYPOINT directive that I used to get MailHog to stop filling up my logs:

["/bin/sh", "-c", "MailHog &>/dev/null"]

Of course, if you are having trouble with something and actually need to look at the logs you will have remove this hack first. Would be great if we could get a verbosity flag for this.

@vchaptsev
Copy link

docker-compose:

mailhog:
  image: mailhog/mailhog
  logging:
    driver: 'none'  # disable saving logs
  ports:
    - '8025:8025'

@savinov
Copy link

savinov commented Apr 2, 2018

Why don't you use your own go-log everywhere in MailHog, but only in main.go?
https://github.com/ian-kent/go-log

eliasp added a commit to ssc-services/salt-formulas-public that referenced this issue Nov 30, 2018
By default, MailHog logs excessively, e.g. every attachment as encoded
string to STDOUT.

This causes major performance issues, as all this has to be persisted by `systemd-journald` and depending on the amount/size of test mails received by MailHog, might keep `systemd-journald` busy at 99% CPU load.

This is a known issue and this workaround should be reverted once upstream fixed it.
See also:
- mailhog/MailHog#56
@tyndyll tyndyll added the 1.1 label Feb 19, 2019
@rhnewtron
Copy link

We use mailhog as target for load tests for html mails. We use Openshift and collect logs to the integrated EFK stacks for all containers. Right now a single Mailhog instance fills gigabytes of logs. For now we disabled logs completely. However a logging verbosity system would be a great feature:

  • Warn: Warnings and Errors only
  • Info: Minimal Metadata (Mail Received with Headers atc)
  • Debug: Metadata (Mail Received with Headers atc)
  • Trace: Current Log

+1

@natearn
Copy link

natearn commented Sep 30, 2021

docker-compose:

mailhog:
  image: mailhog/mailhog
  logging:
    driver: 'none'  # disable saving logs
  ports:
    - '8025:8025'

I'm confused and surprised to learn that doing this causes the mailhog container to hang when sending a PDF attachment. It took me a while to narrow it down to the logging driver specifically.

@gt-novelt
Copy link

docker-compose:

mailhog:
  image: mailhog/mailhog
  logging:
    driver: 'none'  # disable saving logs
  ports:
    - '8025:8025'

also breaks docker compose logs -f

Error response from daemon: configured logging driver does not support reading

@egor83
Copy link

egor83 commented Mar 25, 2023

I wanted to disable logging altogether without building Mailhog's image, so I combined @fnep's solution in #353 and @talawahtech's solution (thanks for these!) a bit, editing docker-compose.yml as follows:

mailhog:
  ...
  entrypoint: ["/bin/sh", "-c", "MailHog &>/dev/null"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.