# How to save logs in a Processing web app using processing.js?

**URL:** <https://discourse.processing.org/t/how-to-save-logs-in-a-processing-web-app-using-processing-js/15196>\
**Category:** Coding Questions\
**Created:** [November 3, 2019, 4:15pm UTC](https://discourse.processing.org/t/how-to-save-logs-in-a-processing-web-app-using-processing-js/15196 "2019-11-03T16:15:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![emabiatch](https://avatars.discourse-cdn.com/v4/letter/e/71c47a/32.png) [@emabiatch](https://discourse.processing.org/u/emabiatch)\
**Post date:** [November 3, 2019, 4:15pm UTC](https://discourse.processing.org/t/how-to-save-logs-in-a-processing-web-app-using-processing-js/15196/1 "2019-11-03T16:15:40Z")

</div>

I am building a simulation of a microwave web app for my thesis. I found out that with Processing was exactly what I was looking for and with the processing.js it is possible to run it in a web page that I’ll use to share the simulation and get user logs.

The main task I have to do is save logs of user actions made on this simulated microwave. Unluckily the commands useful for writing:

- [createWriter()
- [p5.PrintWriter]
- [save()]
- [saveJSON()](
- [saveStrings()]
- [saveTable()]

Just save the output file for the user, while I need to save it where the web app is running (in my case GitHub Pages).

I am sure I am using it correctly since locally everything is ok, but maybe something changes in the web. While the program si running i have the logs into a string, so any other method might be ok too.

Any suggestions or tips about how to fix it or about any different way of how to collect those logs are accepted.

I really appreciate your help, thank you.

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [November 3, 2019, 10:48pm UTC](https://discourse.processing.org/t/how-to-save-logs-in-a-processing-web-app-using-processing-js/15196/2 "2019-11-03T22:48:01Z")

</div>

> [@emabiatch](#):
>
> while I need to save it where the web app is running

possibly there is some miss understanding,  
script from processing .js and p5.js might be  
stored at some ( remote or local ) server  
but they not run there ( as server side code )  
your browser downloads them and they run on your computer  
in the RAM and can create files there too.

and when that script ask you to store the file on your local computer file system  
it feels for you like a download ( from server to client ) but it is not,  
just from your local RAM to your local drive.

anyhow unless having

- server-side code and
- server-side file system declared and
- GET PUT communication

all will be local.

you can save that file local, upload it later  
and use them in the next ( or changed ) script.

also

> **[p5.js, node.js, socket.io](https://github.com/processing/p5.js/wiki/p5.js,-node.js,-socket.io)**
>
> p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Proces...

might give you a idea what could be possible.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [November 8, 2019, 4:40am UTC](https://discourse.processing.org/t/how-to-save-logs-in-a-processing-web-app-using-processing-js/15196/3 "2019-11-08T04:40:53Z")

</div>

You have many options, but a common and we’ll-documented one with some good tutorials is to use [socket.io](http://socket.io) and a server side component for logging.

- [https://github.com/processing/p5.js/wiki/p5.js,-node.js,-socket.io](https://github.com/processing/p5.js/wiki/p5.js,-node.js,-socket.io)
