Answered by:
Encrypting data on Logging Application Block

Question
-
I have a requirememnt to encrypt the messages generated by the logging applicationblock. I am using flat file trace listener and even file trace listener. I am encrypting the message now using the Cryptography application block by using the following code:
using Microsoft.Practices.EnterpriseLibrary.Logging; using Microsoft.Practices.EnterpriseLibrary.Security.Cryptography; LogEntry logEntry = new LogEntry(); logEntry.Message = Cryptographer.CreateHash("SHA1", "Starting the application"); Logger.Write(logEntry);
My question is, is this the proper way or is there any other method which we can encrypt the data? Also, I need to encrypt the automatic properties which are logged in the file. For eg. in the web.config file, we declare as below:
<formatters> <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" template="Timestamp: {timestamp}{newline}
Message: {message}{newline}
Category: {category}{newline}
Priority: {priority}{newline}
EventId: {eventid}{newline}
Severity: {severity}{newline}
Title:{title}{newline}
Machine: {localMachine}{newline}
App Domain: {localAppDomain}{newline}
ProcessId: {localProcessId}{newline}
Process Name: {localProcessName}{newline}
Thread Name: {threadName}{newline}
Win32 ThreadId:{win32ThreadId}{newline}
Extended Properties: {dictionary({key} - {value}{newline})}" name="Text Formatter" /> </formatters>
Now, I need to encrypt the values of the properties which are coming inside the template attribute. Is there any way? Please help.
Thanks,
meeram395
meeram395
Monday, November 5, 2012 10:50 AM
Answers
-
Hi,
For this one, the support that we offer on the application block is over on the page here:
http://msdn.microsoft.com/en-us/library/ff648870.aspx
The link above has samples and documentation on the library. If you do need consulting advise from Microsoft on this library, we can provide that assistance through the following support offering:
https://gettechsupport.microsoft.com/Default.aspx?pesid=14694
Thanks,
Nathan
- Marked as answer by Bob Shen Tuesday, November 20, 2012 2:49 AM
Wednesday, November 7, 2012 6:00 PM
All replies
-
Hi meeram,
I'm trying to involve some senior engineers into this issue and it will take some time. Your patience will be greatly appreciated.
Bob Shen [MSFT]
MSDN Community Support | Feedback to us
Tuesday, November 6, 2012 6:49 AM -
Hi,
For this one, the support that we offer on the application block is over on the page here:
http://msdn.microsoft.com/en-us/library/ff648870.aspx
The link above has samples and documentation on the library. If you do need consulting advise from Microsoft on this library, we can provide that assistance through the following support offering:
https://gettechsupport.microsoft.com/Default.aspx?pesid=14694
Thanks,
Nathan
- Marked as answer by Bob Shen Tuesday, November 20, 2012 2:49 AM
Wednesday, November 7, 2012 6:00 PM