-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Logging doesn't work if mail target added to NLog configuration for web application #1407
Comments
I don't believe this problem existed in 4.3.1, and appears to have been introduced with 4.3.2. Our organization is sticking with 4.3.1 until this is straightened out. |
This also includes WCF applications (I know, they're technically "web" applications). |
This bug is indeed introduced in 4.3.2. Will fix this in 4.3.3. Any idea how to unit test this? bug introduced in #1402 |
I think the code in http://stackoverflow.com/questions/5629209/how-to-replace-openexeconfiguration-in-a-web-context-asp-net-mvc-1 is problematic as it uses system.web, and we don't want a dependency to system.web from NLog. Any thoughts @ivanpointer ? |
note that if smtpDeliveryMethod="network" is used, it mitigates the issue and the exePath exception is not shown, but Nlog does not log anymore |
ATM I'm working on a fix |
This is fixed in NLog 4.3.3. Also the code is more robust - no crash or disabled logging when there are troubles reading the "from" from the SMTP config. |
Thank you! I just now saw the notes and will pull down 4.3.3 to verify. Thanks again! |
👍 |
Type: Bug
NLog version: 4.3.2
Platform: .Net 3.5 / .Net 4.0 / .Net 4.5 / Mono 4 / Silverlight 4 / Silverlight 5
Current NLog config (xml or C#, if relevant):
nothing special, just mail target added to web.config
In case of a BUG:
Exception occurs:
No errors
Possible reason / fix:
When we read SMTP configuration (
MailTarget.MailSettings
property) we don't take into account that it can be executed in scope of web applicationCurrent code:
A special switch for this case should be added. Something like this:
http://stackoverflow.com/questions/5629209/how-to-replace-openexeconfiguration-in-a-web-context-asp-net-mvc-1
The text was updated successfully, but these errors were encountered: