Reputation: 13
Using DotNetNuke 5. I am using the EventLogController along with LogInfo to add custom messages to the event logs in dot net nuke.
Within LogInfo we have a method to Add a Property/Value. I am under the assumption that the Controller.AddLog(logInfo) converts the properties & vlaues into XML using the LogInfo->Serialize method for DNN to store it.
My problem is that I want linebreaks in my message. Is there anyway I can add a newline. "\r\n" wouldn't work,
wouldn't work, CDATA escaped wouldn't work. Everything gets escaped through the Log function.
How do I pretty print the log message myself?
Regards, V
Upvotes: 1
Views: 1397
Reputation: 63126
Sadly, due to the HTML encoding that is done on all messages, you are going to be out of luck trying to do this in the DNN event Log.
Depending on what/where you are, you have a few options.
Log Properties
objLog = new DotNetNuke.Services.Log.EventLog.LogInfo();
objLog.AddProperty("SecureMyInstall", "Phase 2 Error Processing User Accounts");
objLog.LogTypeKey = DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.HOST_ALERT.ToString();
objLogger.AddLog(objLog);
Upvotes: 3
Reputation: 156005
The content of the logs is displayed as HTML, so you should be able to put <br />
to add line breaks.
Upvotes: 1