model view controller - Log4Net failing to write to log -


I have created a new Surface Controller for use with my Umbraco 7.1.8 installation. My code is as follows:

  Public Class Checker: SurfaceController {ILog Log = LogManager.GetLogger (MethodBase.GetCurrentMethod (. DeclaringType); [HPPOST] Submit Public Actionersmart Model (Inquiremodel Models) {Return (; ModelState.ISIIIIDID); // Create a regular expression to delete the script tag Regex regex = new Regex (@ "& lt; script (. +?) * & Lt; / script & gt;"); String request = regex.Replace (model.Message, string.Empty); Request = request + "










< + "Phone:" + Model Telephone + "












< + "Email:" + Model E-mail; Mail message message = new mailmasonry (); message. New = mailAddress (model.Email); message. To Add (new maildood ("info@axumtech.com")); Message.Subject = "New Website Inquiry -" + ModelName; message. Body = request; SmtpClient Client = New SmtpClient (); Try {Client.Send}; TempData ["success"] = true; } Hold (Exception preceding) {TempData ["error"] = true; Logs. Debug ("custom error -" + previous message); Return CurrentUmbracoPage (); } Return redirect tocoroumbreco page (); }}

My problem is that my code fails to send email and simply calls the CurrentUmbracoPage () method.

To resist it and find out what the problem is, I tried to log exceptions that arose using Log4Net, but it does not seem to work because the standard Nothing written on the Umbraco log.

All this is happening on a live server. I have published my development code using Visual Studio 2013 and then uploaded this published site to the server via FTP so that it is sure Could the web find the right SMTP details Entered in the ConfiFif.

One thing that concerns me and one of the reasons for this issue is that despite the fact that this project is actually a part, this published process leaves the controllers and / model folders with my solution. Is this an issue or is it compiled in DLL?

It feels awkward to me that the controller folder is omitted and can potentially tell why an email is not being sent.

< Div class = "post-text" itemprop = "text">

Have you created your project? Your controllers are compiled into a DLL, so there is no need to be included in the published site.

If you are still creating this page, get rid of the try and stop custom errors, so that you can get it - you want this page to fail with fearless feedback.

However, to obtain the logging task:

Create Umbraco.Core.Logging Using the Reef at the Top

Using Umbraco.Core.Logging

< P> in: LogHelper.Error (MethodBase.GetCurrentMethod (). DeclaringType, ex.ToString (), Pre)


Comments