# How is one suppose to do custom logging in wandb especially with the x-axis?

**URL:** <https://community.wandb.ai/t/how-is-one-suppose-to-do-custom-logging-in-wandb-especially-with-the-x-axis/1400>\
**Category:** W&B Help\
**Created:** [November 27, 2021, 12:58am UTC](https://community.wandb.ai/t/how-is-one-suppose-to-do-custom-logging-in-wandb-especially-with-the-x-axis/1400 "2021-11-27T00:58:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![brando](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/brando/32/199_2.png) [@brando](https://community.wandb.ai/u/brando)\
**Post date:** [November 27, 2021, 12:58am UTC](https://community.wandb.ai/t/how-is-one-suppose-to-do-custom-logging-in-wandb-especially-with-the-x-axis/1400/1 "2021-11-27T00:58:10Z")

</div>

I feel I’ve discussed this with someone somewhere (perhaps a gitissue…can’t find it!) but I can’t find it and now I came back and can’t figure out why my wandb command looks the way it does:

```auto
        # - log to wandb
        if log_to_wandb:
            if it == 0:
                wandb.define_metric("train loss", step_metric=it_or_epoch)
                wandb.define_metric("train acc", step_metric=it_or_epoch)
                wandb.define_metric("val loss", step_metric=it_or_epoch)
                wandb.define_metric("val val", step_metric=it_or_epoch)
                # if mdl_watch_log_freq == -1:
                # wandb.watch(args.base_model, args.criterion, log="all", log_freq=mdl_watch_log_freq)
            # - log to wandb
            wandb.log(data={it_or_epoch: it, # custom step,
                            'train loss': train_loss,
                            'train acc': train_acc,
                            'val loss': val_loss,
                            'val acc': val_acc},
                            commit=True)
            # if it == total_its: # not needed here, only needed for normal SL training
            # wandb.finish()

```

can someone help me decipher what this was supposed to mean? Especially the commit option?

* * *

related:

- [https://docs.wandb.ai/guides/track/log](https://docs.wandb.ai/guides/track/log)
- [https://docs.wandb.ai/guides/track/log#customize-axes-and-summaries-with-define\_metric](https://docs.wandb.ai/guides/track/log#customize-axes-and-summaries-with-define_metric)
- [Google Colab](https://colab.research.google.com/drive/1uegSY1HRGlKfK-07Uuw-ZxPJsNA9BN_9#scrollTo=0BIYhmSROGmq)
- [Why isn't wandb logging at the last iteration? (when I want to log figs, ckpts etc) · Issue #89 · wandb/examples · GitHub](https://github.com/wandb/examples/issues/89)

---

<div class="post-metadata">

**Author:** ![lesliewandb](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/lesliewandb/32/369_2.png) [@lesliewandb](https://community.wandb.ai/u/lesliewandb)\
**Post date:** [November 30, 2021, 4:14pm UTC](https://community.wandb.ai/t/how-is-one-suppose-to-do-custom-logging-in-wandb-especially-with-the-x-axis/1400/2 "2021-11-30T16:14:34Z")

</div>

Hi Brando,  
It looks like it is logging steps to our UI. To know more about commit = True, look at this doc [https://docs.wandb.ai/guides/track/log#stepwise-and-incremental-logging](https://docs.wandb.ai/guides/track/log#stepwise-and-incremental-logging)

Warmly,  
Leslie

---

<div class="post-metadata">

**Author:** ![lesliewandb](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/lesliewandb/32/369_2.png) [@lesliewandb](https://community.wandb.ai/u/lesliewandb)\
**Post date:** [December 3, 2021, 5:42pm UTC](https://community.wandb.ai/t/how-is-one-suppose-to-do-custom-logging-in-wandb-especially-with-the-x-axis/1400/3 "2021-12-03T17:42:01Z")

</div>

Hi there, I wanted to follow up on this request. Please let us know if we can be of further assistance or if your issue has been resolved.

---

<div class="post-metadata">

**Author:** ![lesliewandb](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/lesliewandb/32/369_2.png) [@lesliewandb](https://community.wandb.ai/u/lesliewandb)\
**Post date:** [December 6, 2021, 7:48pm UTC](https://community.wandb.ai/t/how-is-one-suppose-to-do-custom-logging-in-wandb-especially-with-the-x-axis/1400/4 "2021-12-06T19:48:01Z")

</div>

Hi Brando, since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)\
**Post date:** [January 26, 2022, 12:59am UTC](https://community.wandb.ai/t/how-is-one-suppose-to-do-custom-logging-in-wandb-especially-with-the-x-axis/1400/5 "2022-01-26T00:59:08Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
