Copied to clipboard

Flag this post as spam?

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


  • Michael Falk 37 posts 59 karma points
    Jan 25, 2015 @ 21:26
    Michael Falk
    0

    What is the correct way to write to UmbracoTraceLog.txt in Umbraco 7

    The title says it all. It should be very simple, but i cannot find it?

    I have an ApiController and just need a couple of log lines, to identify a specific problem

    br
    Michael

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 25, 2015 @ 21:35
    Jan Skovgaard
    0

    Hi Michael

    Perhaps this article by Ismail Mayat can help? http://24days.in/umbraco/2013/log4net-in-umbraco/

    /Jan

  • Michael Falk 37 posts 59 karma points
    Jan 26, 2015 @ 08:12
    Michael Falk
    0

    Thank your for the answer, i have seen several articles about how to add new logs, and stuff like this also, howwever there must be a simple way, in v4 i would use: umbraco.BusinessLogic.Log.Add, but it now says that is shsould use LogHelper, however when trying to do so in an UmbracoApiController, i get, that:

    Umbraco.Web.UmbracoHelper does not contains a definition for Code ...

    What am i missing?

     

  • Michael Falk 37 posts 59 karma points
    Jan 26, 2015 @ 08:16
    Michael Falk
    1

    OK, answering myself, addding

    using Umbraco.Core.Logging;

    then you can call:

    LogHelper.Info(this.GetType(),string.Format("blblb"));

Please Sign in or register to post replies

Write your reply to:

Draft