Problem in logging when another application is invoked from current application

Topics: Logging Application Block
Aug 14, 2012 at 5:02 AM

I have application 'A' and application 'B'. Both applications  run independently. I have implemneted exception handling and logging for both applications using enterprise library and it works perfectly fine.
           App 'A' refers to app 'B' using project reference.  Now I added enterprise library config value for application 'B' in config of application 'A' and it doesnt conflict with config values of application 'A'. Problem that I am facing is, logging is happening for application 'A' but if some exception occurs in application 'B' then its not being logged. Code for logging that exception doesnt throw any error, but it simply ignores those logs. I am trying to write logs in both file and eventviewer, somehow it fails in this integrated scenario of application A and application B.

Can somebody guide me what could be the reason? I have a doubt that it could be because of app domain restrictions though I am not sure.

Aug 14, 2012 at 6:09 AM

I'm not sure I follow.  Do you mean that you have added a reference between two projects (and hence assemblies) but one of the assemblies is not behaving as expected?  There should be no issues as long as the configuration is correct.  Can you post more details along with code and configuration information?

Randy Levy
Enterprise Library support engineer 

Aug 14, 2012 at 6:53 AM

Hi Randy,

            Project(Executable) A and B  can run independently. Both have enterprise logging and exception handling done using EntLib 5.0. which works perfectly fine.

Now project 'B' is being referred in 'A', so now executing assembly for 'B'  is 'A'. Hence I added enterprise library config values for project 'B' in config of 'A'. Now logging for project 'A' continues to happen normally but somehow its not happening in project 'B'. I assume that as 'A' is executing assembly project 'B' will be referring to config values of 'A'.

I cannot post the code/config values due to project constraints. Can you please help me with this?


Aug 15, 2012 at 3:28 AM

Do you have the error special sources configured?  Perhaps an error is occuring (e.g. permissions) that is causing some logging calls to fail?  If not, configure the errors special source to go to a flat file in a directory where permissions are known to be set correctly. 

Randy Levy
Enterprise Library support engineer