The invention relates to log sorting mechanism (56). The log sorting mechanism (56) comprises:a) a one or several part structure (58 88) provided with a space (84) capable of receiving a part of a bunk (44),b) a lever (60) being pivotably attached between its ends to the part structure (58 88) with at least one end of the lever (60) being located in an overlapping arrangement with said space (84), andc) clamping means (66, 68) connecting the part structure (58 86) to the bunk (44).