Hi,
You need to add the Log4Net Assembly as a reference to your project and then use the following as an example.
using log4net;
namespace MyProject.Web
{
public partial class MyCustomControl : SiteModuleControl
{
private static readonly ILog log = LogManager.GetLogger(typeof(MyCustomControl));
}
protected void Page_Load(object sender, EventArgs e)
{
try
{
//try to do something here
}
catch (Exception ex) //try to be more specific with the exception type
{
log.Error("could not do something. Error was: " + ex);
}
}
}
That should get you started with logging in mojoPortal.
HTH,
Joe D.