NET Logging Library
LogXmlDocument Method (ConcreteLog)
Example 



KellermanSoftware.NetLoggingLibrary Namespace > ConcreteLog Class : LogXmlDocument Method
Log an XML Document
Syntax
Public Function LogXmlDocument( _
   ByVal level As LoggingLevel, _
   ByVal document As XmlDocument _
) As LogResponse
Dim instance As ConcreteLog
Dim level As LoggingLevel
Dim document As XmlDocument
Dim value As LogResponse
 
value = instance.LogXmlDocument(level, document)
public LogResponse LogXmlDocument( 
   LoggingLevel level,
   XmlDocument document
)
public:
LogResponse^ LogXmlDocument( 
   LoggingLevel level,
   XmlDocument^ document
) 

Parameters

level
document
Example
ConcreteLog logger = new ConcreteLog();
 
//Licensed Mode
//logger.UserName = "User Name From Receipt";
//logger.LicenseKey = "LicenseKey From Receipt";            
 
//Clear all configuration
logger.ResetConfiguration();
 
//Add a new target, you can also define targets in an xml file, app.config, or web.config
FileTarget fileTarget = new FileTarget(Environment.CurrentDirectory + "\\fileLogger.txt");
logger.Config.Targets.Add(fileTarget);
 
string xmlString = @"<?xml version=""1.0"" encoding=""iso-8859-1""?>
                    <catalog>
                      <cd country=""USA"">
                        <title>Empire Burlesque</title>
                        <artist>Bob Dylan</artist>
                        <price>10.90</price>
                      </cd>
                      <cd country=""UK"">
                        <title>Hide your heart</title>
                        <artist>Bonnie Tyler</artist>
                        <price>10.0</price>
                      </cd>
                      <cd country=""USA"">
                        <title>Greatest Hits</title>
                        <artist>Dolly Parton</artist>
                        <price>9.90</price>
                      </cd>
                    </catalog>";
 
XmlDocument document = new XmlDocument();
document.LoadXml(xmlString);
 
logger.LogXmlDocument(LoggingLevel.DEBUG, document);
Dim logger As New ConcreteLog()
 
'Licensed Mode
'logger.UserName = "User Name From Receipt";
'logger.LicenseKey = "LicenseKey From Receipt";            
 
'Clear all configuration
logger.ResetConfiguration()
 
'Add a new target, you can also define targets in an xml file, app.config, or web.config
Dim fileTarget As New FileTarget(Environment.CurrentDirectory & "\fileLogger.txt")
logger.Config.Targets.Add(fileTarget)
 
Dim xmlString As String = "<?xml version=""1.0"" encoding=""iso-8859-1""?>" & ControlChars.CrLf & "                    <catalog>" & ControlChars.CrLf & "                      <cd country=""USA"">" & ControlChars.CrLf & "                        <title>Empire Burlesque</title>" & ControlChars.CrLf & "                        <artist>Bob Dylan</artist>" & ControlChars.CrLf & "                        <price>10.90</price>" & ControlChars.CrLf & "                      </cd>" & ControlChars.CrLf & "                      <cd country=""UK"">" & ControlChars.CrLf & "                        <title>Hide your heart</title>" & ControlChars.CrLf & "                        <artist>Bonnie Tyler</artist>" & ControlChars.CrLf & "                        <price>10.0</price>" & ControlChars.CrLf & "                      </cd>" & ControlChars.CrLf & "                      <cd country=""USA"">" & ControlChars.CrLf & "                        <title>Greatest Hits</title>" & ControlChars.CrLf & "                        <artist>Dolly Parton</artist>" & ControlChars.CrLf & "                        <price>9.90</price>" & ControlChars.CrLf & "                      </cd>" & ControlChars.CrLf & "                    </catalog>"
 
Dim document As New XmlDocument()
document.LoadXml(xmlString)
 
logger.LogXmlDocument(LoggingLevel.DEBUG, document)
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ConcreteLog Class
ConcreteLog Members