# How to get the logdir of current run when using a function together with Tuner

**URL:** <https://discuss.ray.io/t/how-to-get-the-logdir-of-current-run-when-using-a-function-together-with-tuner/7823>\
**Category:** Uncategorized\
**Created:** [October 7, 2022, 2:55pm UTC](https://discuss.ray.io/t/how-to-get-the-logdir-of-current-run-when-using-a-function-together-with-tuner/7823 "2022-10-07T14:55:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jharaldson](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@jharaldson](https://discuss.ray.io/u/jharaldson)\
**Post date:** [October 7, 2022, 2:55pm UTC](https://discuss.ray.io/t/how-to-get-the-logdir-of-current-run-when-using-a-function-together-with-tuner/7823/1 "2022-10-07T14:55:45Z")

</div>

I have a function that I am using together with Tuner.  
Within the function call I would like to fetch the logdir of the current “run” (not sure if it is called run).  
The logdir would look something like: run\_99d21\_00000\_0\_2022-10-07\_14-37-42  
Using ray.air.session.get\_trial\_name() I am able to get the first part: run\_99d21\_00000, but how can I get also the second part?  
My use case is that I would like to re-use the name of the logdir when storing other data.

---

<div class="post-metadata">

**Author:** ![Jiao\_Dong](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jiao_dong/32/1821_2.png) [@Jiao\_Dong](https://discuss.ray.io/u/Jiao_Dong)\
**Post date:** [October 11, 2022, 11:50pm UTC](https://discuss.ray.io/t/how-to-get-the-logdir-of-current-run-when-using-a-function-together-with-tuner/7823/2 "2022-10-11T23:50:05Z")

</div>

Can you try out `session._status_reporter.logdir` ?

---

<div class="post-metadata">

**Author:** ![jharaldson](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@jharaldson](https://discuss.ray.io/u/jharaldson)\
**Post date:** [October 12, 2022, 2:42pm UTC](https://discuss.ray.io/t/how-to-get-the-logdir-of-current-run-when-using-a-function-together-with-tuner/7823/3 "2022-10-12T14:42:47Z")

</div>

I was not able to run session.\_status\_reporter.logdir, giving an error message that \_status\_reporter does not exist. At least this was the case for ray.air.session.

Instead I importd the session from Tune Trainable:

> from ray.tune.trainable import session  
> session.get\_trial\_dir()
