question

choi dong geun avatar image
choi dong geun asked

How do I save logs for cloud scripts?

I created an item upgrade feature with cloudscript.

I want to record every user upgrade. It could be a problem.

I tried to log, but nothing was recorded except when I ran it.

How do I use a saveable log?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

Do you mean the log function that pre-defined in the CloudScript, as this documentation, especially this section Intermediate Overview: Globals and advanced arguments says, this function is designed for printing the info, not for persistent-recording. Could you tell us why do you want to store the all players’ upgrading item’s records? If your target is analytics, please check our documentations of Playfab Analytics firstly. Then you can use this server API WritePlayerEvent to write a PlayStreamEvent for every item upgrading operation. Then you can query them in the [Event History] page and [Explorer] page. If you have other targets, please clarify it, thanks.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

choi dong geun avatar image choi dong geun commented ·

Sometimes the user protests.
The reason is that the upgrade is wrong.
Then I must prove it.


I thought if I did <log.debug> on CloudScript, I would remain in Event Histroy - player_executed_cloudscript, but there was nothing.

What command should I use to leave a record there?

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang choi dong geun commented ·

If so, the above solution could work. You can use this server API WritePlayerEvent to write a PlayStreamEvent for every item upgrading operation. Then you can query them in the [Event History] page and [Explorer] page.
<log.debug> isn't designed for recording an event in the event history. If you want to write this event -- "player_executed_cloudscript", when you call this API ExecuteCloudScript, please make sure the field GeneratePlayStreamEvent is true.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.