log4net DataPortalcs

log4net DataPortalcs

Old forum URL: forums.lhotka.net/forums/t/1915.aspx


magister posted on Thursday, December 07, 2006

Hello, I have an issue getting log4net to log on the DataPortalcs side.

In my circumstance I have a Premium Rating Calculator being called by the Business Objects themselves, this calculation produces several intermediate values which we want to write to a log for auditing purposes.

It does work when the ASP.NET application is running with a local connection. In this case I have the proper changes to the web.config file and logging does occur.  When I move these changes to the web.config on the DataPortalcs file however the log does not get written.

Has anyone been able to do this?  Is there something I am missing.  Any tips greatly appreciated.

 

 

ajj3085 replied on Thursday, December 07, 2006

Are you using remoting or anything other than the local data portal?

Also, I wouldn't use log4net for auditing purposes.  log4net is a best effort and is not guaranteed to always actually log, so its possible some messages don't get logged and you won't get any notification that nothing has been logged.  I'd log the audit to a database, where at least you'll know if the logging fails or not (because the server is down or something).

magister replied on Thursday, December 07, 2006

fair enough, you would put it in the database.  Basically I don't need all of the intermediate calculations there, and have been asked to write it out to a file......

So anybody else had any luck getting log4net to work on the DataPortalcs ?

 

There seems to be an issue with this.

ajj3085 replied on Thursday, December 07, 2006

Well again, it would be helpful to know what version of Csla, and if you're using a remoting data portal or not.

magister replied on Thursday, December 07, 2006

it is the version for .net 1.1, I think CSLA 1.4 or 1.5

The DataPortalcs is on the same server as the website code which accesses it, although this will change on the Production Server setup.

I think I found the answer, put the log4net web.config settings into the web.config file for the ASP.NET application.  It seems that these are picked up by my server-side calculator which is called by the BusinessObjects.  I ran the asp.net app local first and it worked then I switched it to go over the dataportalcs and put the settings into dataportcs web.config, that did work.  Then I turned on the settings back in asp.net web.config but was still going over the remoting to dataportalcs and it works now.

Anyhow thanks.

ajj3085 replied on Thursday, December 07, 2006

log4net can be pain to get working in Asp.net.  I woudl think that you need the settings in both web.config files.  The issue with not logging under asp.net is usually a permissions one.  If the problem re-occurs, I would check security settings for the file or registry, etc.

Andy

Copyright (c) Marimer LLC