I am trying to setup Logging for DD4T but it doesn't works despite many similar issues/question found.

I was following the fixes mentioned in this question: Enable DD4T Logging - Page Not Found, still i am unable to see anything written in log files. Log Files get created but always have 0 KB size.

Below is Configuration:

    <appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
      <file value="App_Data/dd4t.log" />
      <appendToFile value="true" />
      <maximumFileSize value="100KB" />
      <maxSizeRollBackups value="2" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger [%ndc] - %message%newline" />
      <level value="ALL" />
      <appender-ref ref="RollingFile" />

I am able to browse the home page of my website, so expecting DD4T to write something to logs.

Please suggest what next to check and fix.

  • Try to call XmlConfigurator.Configure() in global.asax.cs? – Hao Peng Jun 5 '17 at 20:40
  • Yes, I have called it in Application_start() of Global.asax.cs file – Arvind thiag Jun 6 '17 at 4:04
  • Do you have this <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> configSections, which version of log4net.dll used. Try to enable debug and access the page <log4net debug="true"> <root> <appender-ref ref="RollingFile" /> <level value="DEBUG" /> </root> </log4net> To make sure application app pool has write permission to log folder – Velmurugan Jun 6 '17 at 7:11
  • Yes, I have the "log4net" section in web.config, also I have tried that 'Debug' thing as well. Can you please confirm which version of DD4T.LogWrappers.Log4Net.dll , I should use? I guess i am doing mistake in using Logwrapper dll – Arvind thiag Jun 6 '17 at 8:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.