Grammar behind 言うには


I recently came accross this sentence:

> 旅人が言うには、腹を空かせた野生の動物たちが、山を下りているらしい。

Which I understand roughly translates to "According to the travellers, some
hungry animals came down from the mountain. What I do not understand is how
言うには works here. I could be wrong, but it doesn't seem to fit に + contrastive
は.

I would like to know how には plays a part in the meaning "according to". Or
maybe if 言うには is just a set phrase, I would be satisfied with that explanation
as well.




This に is a particle explained here: [What does the に do in
表情から察するに?](https://japanese.stackexchange.com/q/29418/5010) This は is a topic
marker and is optional here.

This type of に is literary and used mainly in written Japanese. It attaches to
only a small group of verbs (言う, 見る, 聞く, 思う, 考える, 察する, etc.) in modern
Japanese, so I think it's okay to think of them as just a group of similar set
phrases. (In classical Japanese, it was a [simple conjunctive
particle](https://kobun.weblio.jp/content/%E3%81%AB) similar to と.)




This に is a particle explained here: [What does the に do in
表情から察するに?](https://japanese.stackexchange.com/q/29418/5010) This は is a topic
marker and is optional here.

This type of に is literary and used mainly in written Japanese. It attaches to
only a small group of verbs (言う, 見る, 聞く, 思う, 考える, 察する, etc.) in modern
Japanese, so I think it's okay to think of them as just a group of similar set
phrases. (In classical Japanese, it was a [simple conjunctive
particle](https://kobun.weblio.jp/content/%E3%81%AB) similar to と.)

