private void button2_Click(object sender, EventArgs e) { Events _Logs = Fwk.Logging.Events.GetFromXml <Events>(Fwk.HelperFunctions.FileFunctions.OpenTextFile(_LoggingSection.GetProvider().FileName)); loadingResultsTextBox.Text = _Logs.GetXml(); Target.TargetFactory(TargetType.Xml, ""); }
/// <summary> /// /// </summary> /// <param name="providerName"></param> /// <param name="pEventType"></param> /// <param name="pSource"></param> /// <param name="pText"></param> private void WriteLog(String providerName, EventType pEventType, string pSource, string pText) { // Crea un nuevo Event. Event wEvent = new Event(pEventType, pSource, pText); wEvent.AppId = appId; // Obtiene la Rule asociada al EventType. LogProviderElement wRule = _LoggingSection.GetProvider(); // Escribe el log segĂșn la Rule. Target wTarget = GetTargetByProviderElement(wRule); wTarget.Write(wEvent); // Limpieza. wEvent = null; wRule = null; }
/// <summary> /// /// </summary> /// <param name="providerName">Nombre del proveedor de Logueo</param> /// <param name="ev"></param> /// <param name="path"></param> /// <param name="fileNamePrefix"></param> private static void WriteLog(String providerName, Event ev, string path, string fileNamePrefix) { // Obtiene el provider LogProviderElement provider = _LoggingSection.GetProvider(providerName); // Escribe el log segĂșn la Rule. Target wTarget = GetTargetByProvider(provider, path, fileNamePrefix); wTarget.Write(ev); }