# Export all Logs

**URL:** <https://tech-community.robotics.abb.com/t/export-all-logs/8529>\
**Category:** Developer Tools\
**Created:** [October 27, 2018, 12:19pm UTC](https://tech-community.robotics.abb.com/t/export-all-logs/8529 "2018-10-27T12:19:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterj](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/peterj/32/1688_2.png) [@peterj](https://tech-community.robotics.abb.com/u/peterj)\
**Post date:** [October 27, 2018, 12:19pm UTC](https://tech-community.robotics.abb.com/t/export-all-logs/8529/1 "2018-10-27T12:19:59Z")

</div>

Hello everbody, I got a small Problem. I tried to export all log in Categorys from one real Robot.

I treid to do this in C#, but it will not works. I would be need only the messages, Date, and stuff from the Log.

Later i will put this Stuff in a Database.

Any one do something like this?

---

<div class="post-metadata">

**Author:** ![EugeneB](https://avatars.discourse-cdn.com/v4/letter/e/d07c76/32.png) [@EugeneB](https://tech-community.robotics.abb.com/u/EugeneB)\
**Post date:** [January 3, 2019, 9:50pm UTC](https://tech-community.robotics.abb.com/t/export-all-logs/8529/2 "2019-01-03T21:50:46Z")

</div>

You need to create an instance of EvetLog class and sign with the controller and EventLog properties of that controller.

After you need to create a new variable var and assign that newly created instants with GetCategories properties to that variable.

And use foreach to go through that variable and so on.

Example:

class ControllerLocater

{

private string outputLine = null;

public string OutputLine { get { return outputLine; } set { outputLine = value; } }

private string errorBody = null;

public string ErrorBody { get { return errorBody; } set { errorBody = value; } }

private string bodyText = null;

public string BodyText { get { return BodyText; } }

public void controllerOutput()

{

NetworkScanner ntScann = new NetworkScanner();

ntScann.Scan();

ControllerInfoCollection controllers = ntScann.Controllers;

Controller ctrl = ControllerFactory.CreateFrom(controllers[0]);

EventLog log = ctrl.EventLog;

var categories = log.GetCategories();

foreach (var c in categories)

{

for (int p = 0; p \< c.Messages.Count; p++)

{

bodyText = c.Messages[p].Body;

// some text editing. Not complited – just as an exampl

TextEditor();

Console.WriteLine($“/nType of Log - {c.Type.ToString()}”);

Console.WriteLine($“/n{errorBody}”);

}

c.Dispose();

}

} // end of controllerOutput method

public string TextEditor()

{

outputLine = Regex.Replace(bodyText, “\<.\*?\>”, System.String.Empty);

//ar = Regex.Split(outputLine, pt);

[//Console.ReadKey](https://Console.ReadKey)();

outputLine = Regex.Replace(outputLine, @“.(?! |$)”, ". ");

outputLine = outputLine.Replace(“1)”, "\n\n\bActions \n1) ");

outputLine = outputLine.Replace(“2)”, "\n2) ");

outputLine = outputLine.Replace(“3)”, "\n3) ");

errorBody = outputLine;

return errorBody;

} // end of TextEditor method

} // end of ControllerLocater class
