How to make the Trainer log custom quantities?

Currently, the trainer seems to only record “loss”. Can we add more things that the trainer can log every logging_steps ? For example, I want to add gradient norm and few components of the custom loss I am using. How can I achieve this ?

Thanks in advanced