# Logger Rstudio To File

**URL:** <https://discourse.mc-stan.org/t/logger-rstudio-to-file/791>\
**Category:** RStan\
**Created:** [June 6, 2017, 7:45pm UTC](https://discourse.mc-stan.org/t/logger-rstudio-to-file/791 "2017-06-06T19:45:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![virgodi](https://avatars.discourse-cdn.com/v4/letter/v/f1d935/32.png) [@virgodi](https://discourse.mc-stan.org/u/virgodi)\
**Post date:** [June 6, 2017, 7:45pm UTC](https://discourse.mc-stan.org/t/logger-rstudio-to-file/791/1 "2017-06-06T19:45:01Z")

</div>

Hi,

Is it possible to log the Viewer output of Rstudio to file when running multiple chains in parallel?

Thanks !

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [June 6, 2017, 10:30pm UTC](https://discourse.mc-stan.org/t/logger-rstudio-to-file/791/2 "2017-06-06T22:30:58Z")

</div>

It is in `tempdir()`. It might get deleted after the run is done because we had complaints that they were consuming all of the disk space when calling `stan` many times.

---

<div class="post-metadata">

**Author:** ![elmorjamz](https://avatars.discourse-cdn.com/v4/letter/e/db5fbb/32.png) [@elmorjamz](https://discourse.mc-stan.org/u/elmorjamz)\
**Post date:** [June 8, 2017, 2:34pm UTC](https://discourse.mc-stan.org/t/logger-rstudio-to-file/791/3 "2017-06-08T14:34:41Z")

</div>

Nice question @virgodi  
@boogdri, can you more accurately describe where the temp directory is stored? Wondering if it’s possible to set up an independent process which scrapes from that location.

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [June 8, 2017, 4:22pm UTC](https://discourse.mc-stan.org/t/logger-rstudio-to-file/791/4 "2017-06-08T16:22:45Z")

</div>

When R starts, it makes a random writable directory that is returned by `tempdir()`. I think there is an environmental variable that controls which parent directory is used.

---

<div class="post-metadata">

**Author:** ![denne](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/denne/32/316_2.png) [@denne](https://discourse.mc-stan.org/u/denne)\
**Post date:** [June 14, 2017, 12:27pm UTC](https://discourse.mc-stan.org/t/logger-rstudio-to-file/791/5 "2017-06-14T12:27:16Z")

</div>

I have implemented the inverse: I run Stan in a separate thread and read the log file to display a progress bar in Shiny:

[https://github.com/dmenne/shiny\_stan\_progress](https://github.com/dmenne/shiny_stan_progress)

Most code in server.R
