Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. Extracting Specific Data From XmlLogEntry Object Problem

Extracting Specific Data From XmlLogEntry Object Problem

Scheduled Pinned Locked Moved Design and Architecture
helpxmltutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    malak nour
    wrote on last edited by
    #1

    hello everybody , i really need ur help if you deal with a Enterprise Library Logging Application Block before im trying to extract specific data from the log entery i use XmlLogEntry class and the output into xml file i tried to read from the xml file and it raise error that this xml is being used by another application and i dont know how to extract specifi data from that object i tried to use XML property but it also gave error i need to put Node every time the log works in another xml file becuase you know the output xml form the logging application block is invalid xml formate public void LogFirstFOrmatter(Exception ex,int ex_priority,string title, TraceEventType type,string errormsg,int eventID) { XmlLogEntry myxmlLog = new XmlLogEntry(); myxmlLog.Severity = type; myxmlLog.AddErrorMessage(errormsg); myxmlLog.EventId = eventID; myxmlLog.Message = ex.ToString(); myxmlLog.Priority = ex_priority; myxmlLog.Title = title; Logger.Write(myxmlLog); LoadLogFile("MyLog"); } public XDocument LoadLogFile(string name) { XDocument doc = new XDocument(); var tmpLog = Path.Combine(ConfigurationManager.AppSettings.Get("Path"),name); tmpLog += ".xml"; var fileContent = string.Empty; using (StreamReader reader = new StreamReader(tmpLog)) { fileContent = reader.ReadToEnd(); } doc = XDocument.Parse(fileContent); return doc; }

    M 1 Reply Last reply
    0
    • M malak nour

      hello everybody , i really need ur help if you deal with a Enterprise Library Logging Application Block before im trying to extract specific data from the log entery i use XmlLogEntry class and the output into xml file i tried to read from the xml file and it raise error that this xml is being used by another application and i dont know how to extract specifi data from that object i tried to use XML property but it also gave error i need to put Node every time the log works in another xml file becuase you know the output xml form the logging application block is invalid xml formate public void LogFirstFOrmatter(Exception ex,int ex_priority,string title, TraceEventType type,string errormsg,int eventID) { XmlLogEntry myxmlLog = new XmlLogEntry(); myxmlLog.Severity = type; myxmlLog.AddErrorMessage(errormsg); myxmlLog.EventId = eventID; myxmlLog.Message = ex.ToString(); myxmlLog.Priority = ex_priority; myxmlLog.Title = title; Logger.Write(myxmlLog); LoadLogFile("MyLog"); } public XDocument LoadLogFile(string name) { XDocument doc = new XDocument(); var tmpLog = Path.Combine(ConfigurationManager.AppSettings.Get("Path"),name); tmpLog += ".xml"; var fileContent = string.Empty; using (StreamReader reader = new StreamReader(tmpLog)) { fileContent = reader.ReadToEnd(); } doc = XDocument.Parse(fileContent); return doc; }

      M Offline
      M Offline
      Muhammad Mazhar
      wrote on last edited by
      #2

      Did you read its documentation, this sort of usage information must be documented some where with application.

      Share your experience with others Check my Blog...

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups