# Logging To Assist Debugging App Running in Xojo Cloud

**URL:** <https://forum.xojo.com/t/logging-to-assist-debugging-app-running-in-xojo-cloud/57487>\
**Category:** Xojo Cloud\
**Created:** [September 29, 2020, 8:51am UTC](https://forum.xojo.com/t/logging-to-assist-debugging-app-running-in-xojo-cloud/57487 "2020-09-29T08:51:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Cottrell](https://forum.xojo.com/user_avatar/forum.xojo.com/matthew_cottrell/32/1390_2.png) [@Matthew\_Cottrell](https://forum.xojo.com/u/Matthew_Cottrell)\
**Post date:** [September 29, 2020, 8:51am UTC](https://forum.xojo.com/t/logging-to-assist-debugging-app-running-in-xojo-cloud/57487/1 "2020-09-29T08:51:28Z")

</div>

How does one send logging information to a file, for example error\_log, from an app running in Xojo Cloud for the purposes of debugging? The command line option --Logging isn’t an option for a deployed app and the documentation for:

```
System.log

```

doesn’t really address apps running in Xojo Cloud.

---

<div class="post-metadata">

**Author:** ![Greg\_O\_Lone](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o_lone/32/49_2.png) [@Greg\_O\_Lone](https://forum.xojo.com/u/Greg_O_Lone)\
**Post date:** [September 29, 2020, 9:11am UTC](https://forum.xojo.com/t/logging-to-assist-debugging-app-running-in-xojo-cloud/57487/2 "2020-09-29T09:11:04Z")

</div>

You can use the logging option by adding it to the args array in the App.Open event:

```
Args.AddRow "--logging=/full/path/to/file"

```

That said, you also have access to the actual Apache logs if you turn on SFTP and look in the Logs folder and this won’t affect the performance of your app.

BTW, what is it that you are trying to track down?

---

<div class="post-metadata">

**Author:** ![Matthew\_Cottrell](https://forum.xojo.com/user_avatar/forum.xojo.com/matthew_cottrell/32/1390_2.png) [@Matthew\_Cottrell](https://forum.xojo.com/u/Matthew_Cottrell)\
**Post date:** [September 29, 2020, 9:28am UTC](https://forum.xojo.com/t/logging-to-assist-debugging-app-running-in-xojo-cloud/57487/3 "2020-09-29T09:28:00Z")

</div>

My app needs to refresh a google access token, so I want to confirm that it’s reading a json where the refresh token is stored. Locally I do it like this:

```
Dim jsonToken As New Chilkat.JsonObject
Dim success As Boolean
success = jsonToken.LoadFile("/Users/cottrell/Library/Application Support/MyAccessTokenFolder/googleSheets_with_refresh_token.json")
If (success <> True) Then
  System.DebugLog("Failed to load googleSheets.json")
  Return
End If
```

---

<div class="post-metadata">

**Author:** ![Greg\_O\_Lone](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o_lone/32/49_2.png) [@Greg\_O\_Lone](https://forum.xojo.com/u/Greg_O_Lone)\
**Post date:** [September 29, 2020, 11:58am UTC](https://forum.xojo.com/t/logging-to-assist-debugging-app-running-in-xojo-cloud/57487/4 "2020-09-29T11:58:34Z")

</div>

There’s currently no streaming log available on Xojo Cloud, but you could do this using ExecuteJavascript.

```
ExecuteJavascript("console.log('" + txt +"')")

```

And then if you open the developer tools in your browser, you would see them there.

---

<div class="post-metadata">

**Author:** ![Matthew\_Cottrell](https://forum.xojo.com/user_avatar/forum.xojo.com/matthew_cottrell/32/1390_2.png) [@Matthew\_Cottrell](https://forum.xojo.com/u/Matthew_Cottrell)\
**Post date:** [September 29, 2020, 1:58pm UTC](https://forum.xojo.com/t/logging-to-assist-debugging-app-running-in-xojo-cloud/57487/5 "2020-09-29T13:58:30Z")

</div>

This appears to work very well when called from a web control, such as the opening event of a web page, for example.

But is there a way to make it work within a module where I’m getting an error like this?

```
Module1.RefreshAccessToken, line 53
Static reference to instance method: call this on an instance of class WebControl.
WebControl.ExecuteJavaScript("console.log(5 + 6)")
```

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [September 29, 2020, 2:00pm UTC](https://forum.xojo.com/t/logging-to-assist-debugging-app-running-in-xojo-cloud/57487/6 "2020-09-29T14:00:42Z")

</div>

> [@Matthew\_Cottrell](#):
>
> But is there a way to make it work within a module where I’m getting an error like this?

Yeah it should exist on Session too.

```vb
if Session <> nil then
  Session.ExecuteJavascript("console.log('blah');")
end

```

---

<div class="post-metadata">

**Author:** ![Matthew\_Cottrell](https://forum.xojo.com/user_avatar/forum.xojo.com/matthew_cottrell/32/1390_2.png) [@Matthew\_Cottrell](https://forum.xojo.com/u/Matthew_Cottrell)\
**Post date:** [September 29, 2020, 2:29pm UTC](https://forum.xojo.com/t/logging-to-assist-debugging-app-running-in-xojo-cloud/57487/7 "2020-09-29T14:29:37Z")

</div>

> [@Tim\_Parnell](#):
>
> ```auto
> if Session <> nil then
> Session.ExecuteJavascript("console.log('blah');")
> end
> 
> ```

This is going to be very useful. Thanks much.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [April 29, 2021, 4:43pm UTC](https://forum.xojo.com/t/logging-to-assist-debugging-app-running-in-xojo-cloud/57487/8 "2021-04-29T16:43:16Z")

</div>


