Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am using below log4.net for log in DB but issue here is i want to use encrypted password instead of plain text , if i will use encrypt password how and where decrypt so that it will logs in DB. I have decrypt logic code part.

In General in .net we are keeping encrypt password in web.config file and before passing in connection string in Data access layer we are decrypting and sending .How we will do for log4net in c# website.

<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">

<bufferSize value="1"/>
<connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<connectionString value="Data source=DB IP;Initial catalog=DB NAME;User ID=USER ID;Password=XXX@XXX1234"/>


What I have tried:

This is my connection string in web.config file

<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">

<bufferSize value="1"/>
<connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<connectionString value="Data source=DB IP;Initial catalog=DB NAME;User ID=USER ID;Password=XXX@XXX1234"/>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900