Logging time question

  

I use the Audit action to write to the General Log and I find out the log entries from a loop are interleaving instead of execution flow. Here is the loop:

and here is the log:

Can anyone provide an explanation?


Stanley

Hello Stanley,

I'm not entirely sure the messages are really interleaving.
If you look to the timestamp, you will see that all of them have the same one.

I would say the message log display probably order the messages only by this timestamp.
Being that way, there is no guarantee that the order the records where inserted in the database is being respected on reading data.

I would take a look into the entity itself (I think it is available in the System espace), to check them there and confirm the real order that the messages were entered.

If it is like I suspected, than the Service Center should implement a second sort by the ID, for example...

Cheers,
Eduardo Jauch

Hi Eduardo,

I checked the table for the log and there is no ID column, but as you said the events are happened at almost the same time (sub millisecond). However, running a SELECT SQL and ORDER by the Instant (datetime) column returns the correct order, and I suspect that Service Center is additionally sort by the message. Where can I set the sorting in Service Center?

Stanley

Solution

Hi Stanley,

logging is asynchronous, so the order you see in Service Center may not be the order in your flow.

Solution

Hi Stanley, 

João is right. Loggin is assynchronous.
From documentation:

"You can have multiple LogMessage actions in your action flow. However, the logging is asynchronous and the order of the logs in the environment management console may not be the same as the order of the LogMessage actions in the flow. Therefore, you should not examine the log information in a sequential way."

Regarding the Service Center, I don't think you can change the order of the sorting.

Cheers,
Eduardo Jauch

Thanks, João and Eduardo. I will keep that in mind.