Problem with Log4Net with NHibernate
-
I am writing a windows service that uses NHibernate for performing database access. Now, for debugging and other purpose, i am using log4net that prints log messages and thus we can keep track of the works of the service. But the problem is- if i set log priority to INFO, it prints loads of unnecessary messages related to NHibernate. I want to block these NHibernate info's and want to keep only those messages that i wrote myself(log.info). I don't know where these NHibernate messages are coming and i need a way to stop them. How can i disable the log messages that are automatically written by NHibernate ? Can i filter them out and keep only my log info's ? Please help if any one have any idea.... Thanks
Chayan
-
I am writing a windows service that uses NHibernate for performing database access. Now, for debugging and other purpose, i am using log4net that prints log messages and thus we can keep track of the works of the service. But the problem is- if i set log priority to INFO, it prints loads of unnecessary messages related to NHibernate. I want to block these NHibernate info's and want to keep only those messages that i wrote myself(log.info). I don't know where these NHibernate messages are coming and i need a way to stop them. How can i disable the log messages that are automatically written by NHibernate ? Can i filter them out and keep only my log info's ? Please help if any one have any idea.... Thanks
Chayan
-
Iftekhar Naim wrote:
Can i filter them out and keep only my log info's ?
Have you read the Log4Net documentation?
well, thanks for your reply. I did not actually read the documentation and i was just working according to a sample code. So i had no idea about filter. Now i read how to filter or block log messages. I couldn't make filter work yet. But now it is working using this- category name="NHibernate" level value="Error"/ category So only error messages will be shown now. Please let me know if there is any other better solution. Thanks a lot :) -- modified at 1:42 Wednesday 25th July, 2007
Chayan