docker-archive / docker-registry

This is **DEPRECATED**! Please go to https://github.com/docker/distribution
Apache License 2.0
2.88k stars 879 forks source link

Sending Mail Functionality for Docker registry exception #944

Open xiekeyang opened 9 years ago

xiekeyang commented 9 years ago

@dmp42 @shin- The Registry supports mail sending when exception happens, implemented in app.py. And it works OK by using app.logger.error(), when I simulate. In ADVANCED.md, it describes that 'Setting these options makes the Registry send an email on each code Exception'. However, it looks nowhere in code to use this function, like 'try except' statement. I wonder in which case sending the mail will happens. If I need to add the app.logger.error() in where I want to get exception mail? Thanks a lot!

dmp42 commented 9 years ago

This is correct: you will receive mail only if there is a call for logger.error(). The document ADVANCED should be rephrased to better explain that.

xiekeyang commented 9 years ago

@dmp42 Thanks a lot! I present some explain on “fix Sending Mail Functionality for Docker registry exception #944”. https://github.com/xiekeyang/docker-registry/commit/946c21af14f0155020332be84c4f132d0186c92c Could you please take a look? If it is OK, I'd put a PR.

xiekeyang commented 9 years ago

@dmp42 I think, actually, it is a good idea to add error logeer on each code exception. Therefore, the ADVANCED.md may keep unchanged (usage for config _env may be add in md), and logger add on each 'try except' statement. it will not be executed on normal case, so that impact little on performance. What is your proposal? Thanks a lot!

dmp42 commented 9 years ago

@xiekeyang the registry v1 (here) is in maintenance, and most of the efforts are now focused on the golang rewrite under https://github.com/docker/distribution

If you want to enhance error logging and submit a PR for that, that's fair, and I will review it, but you should not expect things to be worked on beside that.