This works for the nh part, but totally silences all my castle logging
facility logging....

2009/7/7 Fabio Maulo <fabioma...@gmail.com>

> as most <root>
> <priority value="WARN" />
> <appender-ref ref="console" />
>  </root>
>
> <logger name="NHibernate.SQL">
>  <level value="DEBUG" />
> </logger>
>
>
> 2009/7/7 Jan Limpens <jan.limp...@gmail.com>
>
>> Probably it is! I just have to find my way around it :)
>> Right now, whenever I log sql, I have it in all my logs...
>>
>> What I am after is a having distinct log for nh, set to level WARN and a
>> castle log, set to INFO. I do everything in the log4net config....
>>
>> If you don't mind, have look :)
>>
>>     <log4net>
>>         <appender name="rollingFile"
>>                             type="log4net.Appender.RollingFileAppender,
>> Log4Net">
>>             <file value="..\\logs\\shop\\shop-log.log"/>
>>             <appendToFile value="true"/>
>>             <rollingStyle value="Composite"/>
>>             <datePattern value="-yyyy-MM-dd"/>
>>             <staticLogFileName value="true"/>
>>             <maxSizeRollBackups value="100" />
>>             <maximumFileSize value="1MB" />
>>             <layout type="log4net.Layout.PatternLayout, Log4Net">
>>                 <param name="ConversionPattern"
>>                              value="%d [%t] %-5p %c - %m%n"/>
>>             </layout>
>>         </appender>
>>         <appender name="rollingFileNh"
>>                             type="log4net.Appender.RollingFileAppender,
>> Log4Net">
>>             <file value="..\\logs\\shop\\shop-nh.log"/>
>>             <appendToFile value="true"/>
>>             <rollingStyle value="Composite"/>
>>             <datePattern value="-yyyy-MM-dd"/>
>>             <staticLogFileName value="true"/>
>>             <maxSizeRollBackups value="100" />
>>             <maximumFileSize value="1MB" />
>>             <layout type="log4net.Layout.PatternLayout, Log4Net">
>>                 <param name="ConversionPattern"
>>                              value="%d{HH:mm:ss.fff} [%t] %-5p %c -
>> %m%n"/>
>>             </layout>
>>         </appender>
>>         <appender name="rollingFileSql"
>>                             type="log4net.Appender.RollingFileAppender,
>> Log4Net">
>>             <file value="..\\logs\\shop\\shop-sql.log"/>
>>             <appendToFile value="true"/>
>>             <rollingStyle value="Composite"/>
>>             <datePattern value="-yyyy-MM-dd"/>
>>             <staticLogFileName value="true"/>
>>             <maxSizeRollBackups value="100" />
>>             <maximumFileSize value="1MB" />
>>             <layout type="log4net.Layout.PatternLayout, Log4Net">
>>                 <param name="ConversionPattern"
>>                              value="%d{HH:mm:ss.fff} [%t] %-5p %c -
>> %m%n"/>
>>             </layout>
>>         </appender>
>>         <appender name="EventLogAppender"
>>                             type="log4net.Appender.EventLogAppender">
>>             <param name="LogName"
>>                          value="Shop Log" />
>>             <param name="ApplicationName"
>>                          value="Web.Site.MVC" />
>>             <layout type="log4net.Layout.PatternLayout">
>>                 <conversionPattern value="%date [%thread] %-5level %logger
>> [%property{NDC}] - %message%newline" />
>>             </layout>
>>         </appender>
>>         <!-->logger name="NHibernate.SQL">
>>             <level value="DEBUG"/>
>>             <appender-ref ref="rollingFileSql" />
>>         </logger>
>>         <logger name="NHibernate">
>>             <level value="DEBUG"/>
>>             <appender-ref ref="rollingFileNh"/>
>>         </logger-->
>>         <root>
>>             <level value="INFO"/>
>>             <appender-ref ref="rollingFile"/>
>>         </root>
>>     </log4net>
>>
>> See, I even have got the nh loggers turned off (and I think this is why I
>> get these Infos)
>>
>> --j
>>
>>
>> 2009/7/7 Fabio Maulo <fabioma...@gmail.com>
>>
>>> The log4net configuration is not enough ?
>>>
>>>
>>> 2009/7/7 Jan Limpens <jan.limp...@gmail.com>
>>>
>>>> Ah, cool, thought that this meant lots of updates, or worse delete and
>>>> inserts, whenever I loaded a collection.
>>>>
>>>> I have to find out how to have a nh only log on my castle ILogger
>>>> controlled site, because other Infos do interest me :)
>>>>
>>>> Thanks, Fabio!
>>>>
>>>> --J
>>>>
>>>>
>>>>
>>>> 2009/7/7 Fabio Maulo <fabioma...@gmail.com>
>>>>
>>>>>  Mean only that you have the INFO log of NH activated.Log levels
>>>>> OFF <= normal used in production
>>>>> ERROR or WARN <= should be used
>>>>> DEBUG <= in general is used by NH developers
>>>>> INFO <= used by those want become crazy watching the NH's log
>>>>>
>>>>> 2009/7/7 Jan Limpens <jan.limp...@gmail.com>
>>>>>
>>>>> Hello!
>>>>>>
>>>>>> I recently found out that my logs are FULL of these:
>>>>>> ....
>>>>>> 2009-07-07 17:49:43,929 [4] INFO  NHibernate.Engine.Cascade - cascade
>>>>>> NHibernate.Engine.CascadingAction+SaveUpdateCascadingAction for 
>>>>>> collection:
>>>>>> Businesslayer.Theme.Articles
>>>>>> 2009-07-07 17:49:43,929 [4] INFO  NHibernate.Engine.Cascade - done
>>>>>> cascade NHibernate.Engine.CascadingAction+SaveUpdateCascadingAction for
>>>>>> collection: Businesslayer.Theme.Articles
>>>>>> 2009-07-07 17:49:43,929 [4] INFO  NHibernate.Engine.Cascade - done
>>>>>> processing cascade
>>>>>> NHibernate.Engine.CascadingAction+SaveUpdateCascadingAction for:
>>>>>> Businesslayer.Theme
>>>>>> 2009-07-07 17:49:43,930 [4] INFO  NHibernate.Engine.Cascade -
>>>>>> processing cascade
>>>>>> NHibernate.Engine.CascadingAction+SaveUpdateCascadingAction for:
>>>>>> Businesslayer.Marketing.BannerPosition
>>>>>> 2009-07-07 17:49:43,930 [4] INFO  NHibernate.Engine.Cascade - cascade
>>>>>> NHibernate.Engine.CascadingAction+SaveUpdateCascadingAction for 
>>>>>> collection:
>>>>>> Businesslayer.Marketing.BannerPosition.Banners
>>>>>> 2009-07-07 17:49:43,930 [4] INFO  NHibernate.Engine.Cascade - done
>>>>>> cascade NHibernate.Engine.CascadingAction+SaveUpdateCascadingAction for
>>>>>> collection: Businesslayer.Marketing.BannerPosition.Banners
>>>>>> 2009-07-07 17:49:43,930 [4] INFO  NHibernate.Engine.Cascade - done
>>>>>> processing cascade
>>>>>> NHibernate.Engine.CascadingAction+SaveUpdateCascadingAction for:
>>>>>> Businesslayer.Marketing.BannerPosition
>>>>>> 2009-07-07 17:49:43,930 [4] INFO  NHibernate.Engine.Cascade -
>>>>>> processing cascade
>>>>>> NHibernate.Engine.CascadingAction+SaveUpdateCascadingAction for:
>>>>>> Businesslayer.Marketing.BannerPosition
>>>>>> 2009-07-07 17:49:43,930 [4] INFO  NHibernate.Engine.Cascade - cascade
>>>>>> NHibernate.Engine.CascadingAction+SaveUpdateCascadingAction for 
>>>>>> collection:
>>>>>> Businesslayer.Marketing.BannerPosition.Banners
>>>>>> 2009-07-07 17:49:43,930 [4] INFO  NHibernate.Engine.Cascade - done
>>>>>> cascade NHibernate.Engine.CascadingAction+SaveUpdateCascadingAction for
>>>>>> collection: Businesslayer.Marketing.BannerPosition.Banners
>>>>>> 2009-07-07 17:49:43,930 [4] INFO  NHibernate.Engine.Cascade - done
>>>>>> processing cascade
>>>>>> NHibernate.Engine.CascadingAction+SaveUpdateCascadingAction for:
>>>>>> Businesslayer.Marketing.BannerPosition
>>>>>> ....
>>>>>>
>>>>>> a) what does this actually mean?
>>>>>>
>>>>>> b) I am fighting a certain sluggishness especially in relation with
>>>>>> transactions. Could this be the cause? What could I do to improve the
>>>>>> situation?
>>>>>>
>>>>>> Just for illustration the BannerPosition class:
>>>>>>
>>>>>> public class BannerPosition : NamedEntityBase<Guid>
>>>>>>     {
>>>>>>         private readonly ISet<Banner> banners = new
>>>>>> HashedSet<Banner>();
>>>>>>         private readonly Random r = new Random();
>>>>>>
>>>>>>         protected BannerPosition()
>>>>>>         {
>>>>>>         }
>>>>>>
>>>>>>         public BannerPosition(string name)
>>>>>>             : base(name)
>>>>>>         {
>>>>>>         }
>>>>>>
>>>>>>         public virtual ReadOnlyCollection<Banner> Banners
>>>>>>         {
>>>>>>             get { return
>>>>>> SetManager<Banner>.GetSetAsSortedReadOnlyCollection(banners); }
>>>>>>         }
>>>>>>
>>>>>>         public virtual uint Hits
>>>>>>         {
>>>>>>             get { return (uint) banners.Sum(b => b.Hits); }
>>>>>>         }
>>>>>>
>>>>>>         public virtual void AddBanner(string imageSource, string url,
>>>>>> string text)
>>>>>>         {
>>>>>>             SetManager<Banner>.Add(new Banner(imageSource, url, text),
>>>>>> banners);
>>>>>>         }
>>>>>>
>>>>>>         public virtual void RemoveBanner(Guid id)
>>>>>>         {
>>>>>>             var banner = banners.Where(b => b.Id ==
>>>>>> id).SingleOrDefault();
>>>>>>             if (banner != null)
>>>>>>                 SetManager<Banner>.Remove(banner, banners);
>>>>>>         }
>>>>>>
>>>>>>         public virtual Banner GetRandom()
>>>>>>         {
>>>>>>             var bs = banners
>>>>>>                 .Where(b => b.IsActive)
>>>>>>                 .ToList();
>>>>>>             if (bs.Count == 0)
>>>>>>                 return null;
>>>>>>             if (bs.Count == 1)
>>>>>>                 return bs[0];
>>>>>>             var idx = r.Next(0, bs.Count);
>>>>>>             return bs[idx];
>>>>>>         }
>>>>>>     }
>>>>>>
>>>>>> and it's mapping (generated by nhf)
>>>>>>
>>>>>>   <class name="Businesslayer.Marketing.BannerPosition, Businesslayer,
>>>>>> Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
>>>>>> table="`BannerPosition`" xmlns="urn:nhibernate-mapping-2.2">
>>>>>>     <id name="Id" type="Guid" column="BannerPositionID">
>>>>>>       <generator class="guid.comb" />
>>>>>>     </id>
>>>>>>     <property name="Name" type="String">
>>>>>>       <column name="Name" length="32" />
>>>>>>     </property>
>>>>>>     <property name="Key" type="String"
>>>>>> index="INDEX_BannerPosition_BusinessKey">
>>>>>>       <column name="BusinessKey" length="32" not-null="true"
>>>>>> unique="true" />
>>>>>>     </property>
>>>>>>     <set name="Banners" access="field.camelcase" cascade="all">
>>>>>>       <key foreign-key="FK_BannerPosition_Banner"
>>>>>> column="BannerPositionID" />
>>>>>>       <one-to-many class="Businesslayer.Marketing.Banner,
>>>>>> Businesslayer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
>>>>>>     </set>
>>>>>>   </class>
>>>>>>
>>>>>> --
>>>>>> Jan
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Fabio Maulo
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Jan
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Fabio Maulo
>>>
>>>
>>>
>>
>>
>> --
>> Jan
>>
>>
>>
>
>
> --
> Fabio Maulo
>
> >
>


-- 
Jan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to nhusers@googlegroups.com
To unsubscribe from this group, send email to 
nhusers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to