logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernhard Heinzel <bernhard.hein...@live.com>
Subject RE: How to pass password to AdoNetAppender?
Date Wed, 22 Oct 2008 15:11:25 GMT
Thanks Michael.

But my Problem is that I have to configure the AdoNetAppender with a config file so I don't
have to recompile if I change the database.



From: Michael.Richman@pgn.com
To: log4net-user@logging.apache.org
Date: Wed, 22 Oct 2008 07:55:41 -0700
Subject: RE: How to pass password to AdoNetAppender?










You can set the connection string in code, here is some sample 
code, you only have to do this once and then you can use the AdoNetAppender 
multiple times.
 

log4net.Config.XmlConfigurator.Configure();
log4net.Repository.Hierarchy.Hierarchy h = 
(log4net.Repository.Hierarchy.Hierarchy)
log4net.LogManager.GetRepository();
log4net.Appender.AdoNetAppender adoAppender = 
(log4net.Appender.AdoNetAppender)
h.Root.GetAppender("AdoNetAppender_UserLog");
adoAppender.ConnectionString = <set 
your connection string here>;



From: Bernhard Heinzel [mailto:bernhard.heinzel@live.com] 

Sent: Wednesday, October 22, 2008 7:17 AM
To: Log4NET 
User
Subject: RE: How to pass password to 
AdoNetAppender?



Thanks Georg.

Unfortunatly integrated 
Security is not an option.
Seems it is not as trivial as it seems...
Any 
other suggestions?

Bernhard



From: Georg.Jansen@Faktnet.com
To: 
log4net-user@logging.apache.org
Subject: RE: How to pass password to 
AdoNetAppender?
Date: Wed, 22 Oct 2008 14:56:36 +0200








Bernhard,
 
This 
maybe of the point in your case, but have you considered using integrated 
security?
 
You 
could store the username and password encrypted, but then you have the added 
problem of securing the encryption key.
 
Maybe 
one of the links below is useful:
 
http://msdn.microsoft.com/en-us/library/89211k9b.aspx
http://www.theserverside.net/tt/articles/showarticle.tss?id=NewSecurityFeatures
 
 
Best 
regards
Georg
Log4Net 
Dashboard – Log Analysis and Monitoring made easy!
http://www.l4ndash.com
 
 
 


From: Bernhard 
Heinzel [mailto:bernhard.heinzel@live.com] 
Sent: 22. oktober 2008 
14:08
To: lLog4NET Users
Subject: How to pass password to 
AdoNetAppender?
 
Hi,

another 
Question from the new guy.
I want to pass the username and password for the 
database to the AdoNetAppender.

The two ways I found were:
* Plaintext 
in the config file.
* 'Plaintext' in the sourcecode.

Both ways are not 
optimal, so were I missing something? Is there a smarter way of passing a 
password?

Thanks in advance.

Regards
Bernhard
 



Connect to the next 
generation of MSN Messenger  Get it now! 


Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy! Try it! 

_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
Mime
View raw message