Copied to clipboard

Flag this post as spam?

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


  • Bo Kingo Damgaard 157 posts 456 karma points
    Mar 05, 2013 @ 09:37
    Bo Kingo Damgaard
    0

    Setting uSignalrAppender wrongly up in log4net.config

    Hi

    The installer seems to setup the appender wrong in the log4net.config. Both the appender-ref and appender tags are inserted INTO the existing tags instead og NEXT TO. See my config here:

    <?xml version="1.0"?>
    <log4net>
      <root>
        <priority value="Info" />
        <appender-ref ref="AsynchronousLog4NetAppender">
        <appender-ref ref="uSignalrAppender" />
        </appender-ref>
      </root>
      <!--To Change the way logging works for certain namespaces, insert a new logger like: -->
      <!--
        <logger name="Umbraco.Core">
            <level value="WARN" />
        </logger>-->
      <appender name="AsynchronousLog4NetAppender" type="Umbraco.Core.Logging.AsynchronousRollingFileAppender, Umbraco.Core">
        <file value="App_Data\Logs\UmbracoTraceLog.txt" />
        <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
        <appendToFile value="true" />
        <rollingStyle value="Date" />
        <maximumFileSize value="5MB" />
        <layout type="log4net.Layout.PatternLayout">
          <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
        </layout>
        <appender name="uSignalrAppender" type="USignalrLog4net.SignalrAppender">
          <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%date %-5level - %message%newline" />
          </layout>
        </appender>
      </appender>
    </log4net>

    This prevents logging to signalr

    /Bo

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Mar 05, 2013 @ 09:59
    Ismail Mayat
    0

    Bo,

    Arrrrgghhhh! I thought that was fixed. I am using the package actions contrib update xml file as post install action. I have it set to add the updates to the end of appender and appender-ref nodes basically i have 

        <Action runat="install" undo="false" alias="AddXmlFragment" file="~/config/log4net.config" xpath="//root/appender-ref" position="end">
          <appender-ref ref="uSignalrAppender"></appender-ref>
        </Action>
        <Action runat="install" undo="false" alias="AddXmlFragment" file="~/config/log4net.config" xpath="//appender" position="end">
          <appender name="uSignalrAppender" type="USignalrLog4net.SignalrAppender">
            <layout type="log4net.Layout.PatternLayout">
              <conversionPattern value="%date %-5level - %message%newline" />
            </layout>
          </appender>
        </Action>

    Not sure why its adding it in the wrong place?? Just move it out into its proper place and it should work.

    Regards

    Ismail

  • Bo Kingo Damgaard 157 posts 456 karma points
    Mar 05, 2013 @ 15:13
    Bo Kingo Damgaard
    0

    Hmm.. I haven't used PAC before but maybe the xpath for the appender-ref should be "//root", specifying that the snippet should be appended to the end of the "root" element? And the appender likewise, xpath="/log4net"?

    Just a thought

    /Bo

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Mar 26, 2013 @ 16:08
    Warren Buckley
    0

    Hello Bo.
    I would recommend installing LiveLogger via nuget now
    https://nuget.org/packages/LiveLogger.Umbraco

    Cheers,
    Warren :) 

Please Sign in or register to post replies

Write your reply to:

Draft