Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Problem with Log4Net with NHibernate

Problem with Log4Net with NHibernate

Scheduled Pinned Locked Moved C#
helpquestiondatabase
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Iftekhar Naim
    wrote on last edited by
    #1

    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

    L 1 Reply Last reply
    0
    • I Iftekhar Naim

      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

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Iftekhar Naim wrote:

      Can i filter them out and keep only my log info's ?

      Have you read the Log4Net documentation?

      I 1 Reply Last reply
      0
      • L led mike

        Iftekhar Naim wrote:

        Can i filter them out and keep only my log info's ?

        Have you read the Log4Net documentation?

        I Offline
        I Offline
        Iftekhar Naim
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups