iBATIS.Net, Common.Logging, and NLog

323 views
Skip to first unread message

panji aryaputra

unread,
Jul 10, 2012, 2:38:18 AM7/10/12
to mybatis...@googlegroups.com
Hi all, looking at this configuration (from another thread), I found it rather strange:

<iBATIS>
<logging>
<logFactoryAdapter type="IBatisNet.Common.Logging.Impl.Log4NetLoggerFA, IBatisNet.Common.Logging.Log4Net">
<arg key="configType" value="external"/>
</logFactoryAdapter>
</logging>
</iBATIS>

If iBATIS uses Common.Logging, why does it have an assembly specific to Log4Net (IBatisNet.Common.Logging.Log4Net)? I thought Common.Logging hides the underlying logging library used. 

I was actually trying to find ways to use NLog with iBATIS.Net when I saw this config. Any pointers are most appreciated.

Thanks.

Regards,
Panji

Pedro Sousa

unread,
Jul 10, 2012, 4:45:41 AM7/10/12
to mybatis...@googlegroups.com
Hi Panji,

I'm using mybatis and have the config like this:

    file: app.config    
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
<!-- Logging para o MyBatis-->
    <sectionGroup name="iBATIS">
      <section name="logging" type="IBatisNet.Common.Logging.ConfigurationSectionHandler, IBatisNet.Common" />
    </sectionGroup>
  </configSections>
  
  <iBATIS>
    <logging>
      <logFactoryAdapter type="IBatisNet.Common.Logging.Impl.ConsoleOutLoggerFA, IBatisNet.Common">
        <arg key="showLogName" value="true" />
        <arg key="showDataTime" value="true" />
        <arg key="level" value="ALL" />
        <arg key="dateTimeFormat" value="yyyy/MM/dd HH:mm:ss:SSS" />
      </logFactoryAdapter>
    </logging>
  </iBATIS>
  
  <startup>
  </startup>
  
  <runtime>
  </runtime>
</configuration>

Hope is useful to you.


Regards,
Pedro Sousa
--
Pedro Sousa

Ron Grabowski

unread,
Jul 10, 2012, 7:53:22 AM7/10/12
to mybatis...@googlegroups.com
iBatis doesn't using Common.Logging. That's just how we named the assembly. To use NLog you'll need to write your own factory adapter.


From: panji aryaputra <pap...@gmail.com>
To: mybatis...@googlegroups.com
Sent: Tuesday, July 10, 2012 2:38 AM
Subject: iBATIS.Net, Common.Logging, and NLog

Reegan

unread,
Feb 15, 2013, 5:55:38 AM2/15/13
to mybatis...@googlegroups.com

I want to smale sample code using Ibiatis in .net

lang x

unread,
Feb 15, 2013, 8:33:11 PM2/15/13
to mybatis...@googlegroups.com
you can download NPetShop 


2013/2/15 Reegan <reeg...@gmail.com>

I want to smale sample code using Ibiatis in .net

--
You received this message because you are subscribed to the Google Groups "mybatisnet-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatisnet-us...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages