Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Topic author was deleted

    May 07, 2013 @ 15:17

    LogHelper not working from IApplicationEventHandler v6.0.4

    I'm really trying hard to like v6, but I keep running into 'new ways' of doing just about everything.  Part of my development process is to log info from time to time.  However I cannot get the new LogHelper to log from my IApplicationEventHandler.

    I know the code is executing since the nodes DO change (line just before the log statement), but nothing appears in the log.  For fun, I also tried the 'old way' of logging and that does not work either.

    The intellisense says it logs if tracing is enabled.  I tried to enable tracing in the web.config.  But I hope that doesn't mean I have to have tracing on for any logging.

    Code is as follows:

    namespace SimpleForms
    {

    public class SimpleFormCreate : IApplicationEventHandler
    {

    private static object _lockObj = new object();
    private static bool _ran = false ;

    public void OnApplicationStarted(UmbracoApplicationBase httpApplication, Umbraco.Core.ApplicationContext applicationContext)
    {
    // lock
    if (!_ran)
    {
    lock (_lockObj)
    {
    if (!_ran)
    {
    BaseTree.BeforeNodeRender += new BaseTree.BeforeNodeRenderEventHandler(this.BaseTree_BeforeNodeRender);
    _ran = true;
    }
    }
    }
    }

    public void OnApplicationStarting(UmbracoApplicationBase httpApplication, Umbraco.Core.ApplicationContext applicationContext)
    {
    }

    public void OnApplicationInitialized(UmbracoApplicationBase httpApplication, Umbraco.Core.ApplicationContext applicationContext)
    {
    }

    private void BaseTree_BeforeNodeRender(ref XmlTree sender, ref XmlTreeNode node, EventArgs e)
    {
    node.Text+=" changed";
    LogHelper.Debug(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "icon=>" + node.Icon);
    }

    }
    }

     

  • Comment author was deleted

    May 07, 2013 @ 18:58

    Update.  Logging not working at all.

    Log.Add(LogTypes.Debug, 0, "Logging...");

    LogHelper.Debug(typeof(Editform), "Logging...");
  • Comment author was deleted

    May 08, 2013 @ 14:22

    changing forum topics after I upgraded to v6.0.5. 

    Not really related to the event model

    http://our.umbraco.org/forum/developers/api-questions/40760-Logging-not-working-605

Please Sign in or register to post replies

Write your reply to:

Draft