A person attending any court or other tribunal, under a summons or recognizance as a witness, shall receive not less than ten nor more than $20, to be fixed by the court or other tribunal, for each day's attendance and 15¢ per mile for each mile necessarily traveled to the place of attendance, and the same for returning, plus all necessary bridge, ferry and road tolls. On his oath, an entry of the sum he is entitled to, and for what, and by what party it is to be paid, shall be made. When the attendance is before either house or a committee of the Legislature, such entry shall be made by the clerk of such house or the chairman of such committee, and in other cases by the clerk of the court or other tribunal before which, or by the person before whom, the witness attended. A witness summoned or recognized to attend in several cases may have the entry made against any one of the parties by whom he is summoned, or for whom he is sworn as a witness, but no witness shall be allowed for his attendance in more than one case at the same time. But no compensation shall be allowed to a witness before a grand jury. This section shall not apply to witnesses before justices of the peace.