Am trying to log my traces using common logging with log4net, am able to get my traces by using log4net but on top of it when i try with common logging dll then could nt able to get my traces .advices will be helpful.

    <sectionGroup name="common">
      <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
      <factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4net1213">
        <arg key="level" value="ALL" />
        <arg key="configType" value="INLINE" />

    <appender name="FileAppender" type="log4net.Appender.RollingFileAppender">
      <file value="applog.txt" />
      <appendToFile value="true" />
      <rollingStyle value="Size" />
      <maxSizeRollBackups value="10" />
      <maximumFileSize value="10MB" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
    <appender name="TraceAppender" type="log4net.Appender.TraceAppender">
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
    <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date{ABSOLUTE} [%thread] %level %logger - %message%newline" />
      <level value="ALL" />
      <appender-ref ref="TraceAppender" />
      <appender-ref ref="FileAppender" />
      <appender-ref ref="ConsoleAppender" />

  public static class Test
        private static ILog log = LogManager.GetLogger("FileAppender"); 
        public static DataSet GetLog(ConnectionInstance connection)
                    log.Trace("Entered to View Pupil premium Log");
                     log.WarnFormat("Do Data -->No match for log ID and preview value for the Pupil Premium values!!");
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.