RobotStudio event

FPSDK 5.15 - EventLogCategory[ ] GetCategories()

Hi,
I need of automatically write all Event message about the controller where run my FP application on a .csv file.
I using EventLog class and in particular this code to get message event from controller:

{
            this.cntrl = new Controller();

            System.IO.StreamWriter fileSTRM = new              System.IO.StreamWriter(cntrl.FileSystem.RemoteDirectory+"/cLog.csv", false, System.Text.Encoding.Unicode);

            fileSTRM.AutoFlush = true;

            fileSTRM.WriteLine(WriteColumnHeader());
        
            EventLogCategory[] eCategories = cntrl.EventLog.GetCategories();

            foreach (EventLogCategory ev_cat in eCategories)
            {
                foreach (EventLogMessage ms in ev_cat.Messages)
                {
                    fileSTRM.WriteLine(EventLogMessageToString(ms));
                }
            }

            fileSTRM.Flush();
            fileSTRM.Close();
            fileSTRM = null;

            return false;
}

The problem is that the numers of messages gets from EventLog.GetCategories() is not the same as i get (and save) the message manually from event panel of FlexPendat or Robostudio Online.
I have made many test on virtual controller and always the messages gets from Robostudio Online is much more that 
i get from EventLog.GetCategories(). Why this? maybe is a bug?
There is some way to automatically get all event messages from controller and save it (reparsed) on a file by scheduling (for example every week)?

In attachment there is a example code project build with VS2005, the eventLog created from my app. and the .log saved from Robostudio Online of same virtual controller.

webwiz/3572/WriteLogTest.zip

regars
Ecapitanio


Comments