This shows a very simple way to fix a splinter on a 2x4 or 4x4 (or any other size lumber size) without breaking off the separated shard.
The two key "tricks" are to use dental floss to get the glue all the way up to where the splinter first separates from the main 4x4, and the second is to use a brad nailer, using the shortest possible brad, in order to hold the splinter in place while the glue dries. The glue is what will hold the splinter in place, not the nail. In the case where the splinter is too thin for the brad to hold, I use painter's tape instead.