Enterprise Library Logging not working in production RRS feed

  • Question




    We are using Enterprisi Library (Microsoft.Practices.EnterpriseLibrary.Logging.dll) for logging purposes.


    On the local machine - it works great, but in production - it does'n. It does not write to log file or event log.


    Could you please let me know what can we do about it?


    Thank you.

    Friday, October 24, 2008 3:13 PM

All replies

  • Could be a permission issue...  You can try couple things.



    If possible, deploy debug version of the binary in the production environment, attach a remote debugger to troubleshoot.


    I would suggest build a small application that encapsulates EntLib in a try catch block and see what error it is getting.


    { Gaja; }



    Friday, October 24, 2008 6:11 PM

    Should we put Enterprise Library dlls in Gac?
    Friday, October 24, 2008 6:36 PM
  • atleast thats how I have used in the past, especially for logging framework, it works good if it is in GAC. 


    Friday, October 24, 2008 8:27 PM
  • Make sure that you are not eating away any exceptions. Many a times it so happens that the EL code to write to event log throws some exception but a catch at a higher level silently eats it away, thus not allowing you to understand the actual issue. This is the reason it is suggested not to catch any general exceptions.


    You can create a scenario for an exception (so you know which catch will be invoked) and then if the exception doesnt get logged, check the if any catch statements are eating exception in the above layers.


    Hope this helps



    Friday, October 24, 2008 8:51 PM
  • Hi,


    Does the thread/process that is logging the exceptions have enough permissions to log into the event log or file?

    This is the first thing I would check.





    Friday, October 24, 2008 9:10 PM

    Where and how do I check that?


    Thank you.

    Friday, October 24, 2008 10:08 PM
  • The below links provides details on how to give access permissions to Network Services on various resources. (includes eventlog and Files)




    You can follow the same approach for the account that is being used in your application.




    Friday, October 24, 2008 10:21 PM
  • There are quite a fea possible cause for this. We've outlined some of them and provided suggestions and workarounds in this FAQ article.


    Monday, February 21, 2011 10:30 PM
  • Hi,

    Enterprise Library Logging not working in production.

    I am using enterprises library 5.0 version for exception handling .It is working fine in my local system.Logging error in database.but when i deploy in production it is not logging in database.

    could u please let me know the solution.




    Tuesday, June 21, 2011 3:37 AM
  • As outlined above in the thread there are two likely causes.

    1) Permissions.

    2) The exceptions are being handled by code.  The latter you can obviously test for and prove/disprove easy enough.


    As an aside.

    Personally, I prefer to have my own global exception handler and call a web service to write the error away.

    EL doesn't save much work and if I write it myself I understand what my code does way better.

    Tuesday, June 21, 2011 9:29 AM
  • Why you cannot use System.Exception assembly for your custom custom exception handling , in case of any major flaws which is less probable situation , You can contact Microsoft directly. 

    It is very simple and start forward design and implementation. 

    • Proposed as answer by Eramasz Tuesday, September 6, 2011 9:03 AM
    • Unproposed as answer by Eramasz Tuesday, September 6, 2011 9:03 AM
    Wednesday, June 22, 2011 5:16 AM
  • Try using any third party application software like event log analyzer, I used to use manage engine event log analyzer a small software works on net client, its good as it creates report of all logs in our organization we have around 500 - 700 employees this was the best possible solution I could find


    • Proposed as answer by Eramasz Tuesday, September 6, 2011 9:03 AM
    Tuesday, September 6, 2011 9:03 AM